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,
Who is Participating?

Improve company productivity with a Business Account.Sign Up

anilbathulaConnect With a Mentor Commented:
Use removeAllElements() or just U create the new Instances of the same vector.
Jim CakalicSenior Developer/ArchitectCommented:
The pre-Collections method in Vector is removeAllElements.

Jim Cakalic
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()
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.