Solved

Remove All Elements from a Vector in JDK1.1.6

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 95
Oracle SQL syntax check  without executing 6 50
fibonacci ten numbers 4 38
String array comparison 4 32
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

815 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

8 Experts available now in Live!

Get 1:1 Help Now