Solved

Remove All Elements from a Vector in JDK1.1.6

Posted on 2000-05-11
4
254 Views
Last Modified: 2010-04-01
What is the method that flushes a Vector in JDK1.1.6.  In 2.0 the clear() method works.


Thanks in advance,
0
Comment
Question by:ubsjmg
4 Comments
 
LVL 19

Expert Comment

by:Jim Cakalic
ID: 2801464
The pre-Collections method in Vector is removeAllElements.

Jim Cakalic
0
 
LVL 3

Expert Comment

by:Laminamia063099
ID: 2801713
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
 

Expert Comment

by:maheshsivakumar
ID: 2803410
As far as I know
It should be removeAllElements()
0
 

Accepted Solution

by:
anilbathula earned 50 total points
ID: 2816026
Use removeAllElements() or just U create the new Instances of the same vector.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question