Solved

Remove All Elements from a Vector in JDK1.1.6

Posted on 2000-05-11
4
251 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

929 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now