Difference Between Collection and Legacy classes

What are the difference between Legacy classes and Collection other than Synchronized?

Questions by Senthilkumarb

Showing Answers 1 - 9 of 9 Answers

satyd

  • Jan 10th, 2008
 

Legacy classes are classes which exist to provide forwards compatibility to existing programs, but for which there are better alternatives.
Some are like Vector, Stack, HashTable. All of which are synchronized.

Use ArrayList in stead of Vector if you don't want thread safe for the collection whenever you add/remove/access objects at end and middle of collection.
Same way use HashMap in stead of HashTable

  Was this answer useful?  Yes

sampra

  • Feb 11th, 2008
 

legacy class are syncronized by defult where as collection's member are not syncronized by deflt

  Was this answer useful?  Yes

udaya.kumar

  • Dec 12th, 2008
 

Legacy Classes : Previously Collection Frame Work was not part of java.util package. Later some of the classes were re-engineered Known as Legacy Classes. Legacy Classes are SYNCRONIZED(Ctrlng accessibility over the resource).
Ex:Vector/Stack/Hashtable/Dictionary/Properties.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions