Link to home
Start Free TrialLog in
Avatar of ubsjmg
ubsjmg

asked on

Remove All Elements from a Vector in JDK1.1.6

What is the method that flushes a Vector in JDK1.1.6.  In 2.0 the clear() method works.


Thanks in advance,
Avatar of Jim Cakalic
Jim Cakalic
Flag of United States of America image

The pre-Collections method in Vector is removeAllElements.

Jim Cakalic
Avatar of Laminamia063099
Laminamia063099

If you want to clear a Vector, the simplest way (that works for any class) would be to create a new one, which would drop the handle to the old one which would then be garbage collected later.  This, however, only would work if the Vector was only referenced by one object.

Just my 1/2 cent.

Laminamia :)
As far as I know
It should be removeAllElements()
ASKER CERTIFIED SOLUTION
Avatar of anilbathula
anilbathula

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial