[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

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,
0
ubsjmg
Asked:
ubsjmg
1 Solution
 
Jim CakalicSenior Developer/ArchitectCommented:
The pre-Collections method in Vector is removeAllElements.

Jim Cakalic
0
 
Laminamia063099Commented:
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 :)
0
 
maheshsivakumarCommented:
As far as I know
It should be removeAllElements()
0
 
anilbathulaCommented:
Use removeAllElements() or just U create the new Instances of the same vector.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now