Expand|Select|Wrap|Line Numbers
- public class ClassX{
- public ShapeObj(){}
- public doThis(){}
- }
Expand|Select|Wrap|Line Numbers
- Vector xv = new Vector();
- xv.add(new ClassX());
- xv.add(new ClassX());
- xv.add(new ClassX());
- xv.add(new ClassX());
Expand|Select|Wrap|Line Numbers
- ListIterator it = objlist.listIterator();
- while(it.hasNext()){
- ClassX temp = it.next();
- temp. doThis();
- }
Expand|Select|Wrap|Line Numbers
- ListIterator it = objlist.listIterator();
- while(it.hasNext()){
- Object temp = it.next();
- temp. doThis();
- }
So how can I cycle through the vector and run a method on each element?
Cheers, Josh