Perry Smith

Java Questions & Answers

Archive

Home / Java Q & A Archive Page 4 / Java Q & A Archive / Java Main Page

vectors
Wednesday, 24-Feb-99 17:41:37
208.254.224.135 writes:

How do you access each components of the separate objects in the vector? If I have an object that has 3 methods inside the vector ..how could I call the methods individually?
Thanks,
Raf

RafBayani@earthlink.net


Response
Re: vectors
Thursday, 25-Feb-99 20:18:06
152.205.22.243 writes:
You retrieve the element using

obj1 = vecWhatever.elementAt(iSomeIntegerIndex);

then you cast it to the appropriate type

smclSomething = (SomeClass) obj1;

then you call the method

smclSomething.doSomething();


MikeD

Home / Java Q & A Archive Page 4 / Java Q & A Archive / Java Main Page