Solved

Remove All Elements from a Vector in JDK1.1.6

Posted on 2000-05-11
4
250 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
Comment Utility
The pre-Collections method in Vector is removeAllElements.

Jim Cakalic
0
 
LVL 3

Expert Comment

by:Laminamia063099
Comment Utility
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
Comment Utility
As far as I know
It should be removeAllElements()
0
 

Accepted Solution

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

763 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

10 Experts available now in Live!

Get 1:1 Help Now