I recently heard Vector is a Legacy class
, then I read on a website that
Legacy classes are used to save Objects before Collections came.
So, why these are not called Deprecated
classes, why Legacy
?
They only contained some classes and an interface, which were used to store objects. These are called as Legacy classes and Legacy Interface. The Legacy classes are synchronized as opposed to the classes in the collection framework. The Legacy classes are Dictionary, Hashtable, Properties, Stack, and Vector.
Correct Option: D. Stack, Hashtable, Vector, Properties and Dictionary are legacy classes.
Legacy classes and interfaces are the classes and interfaces that formed the collections framework in the earlier versions of Java and how now been restructured or re-engineered. They are fully compatible with the framework.
Formally are not deprecated.
All legacy classes were re-engineered to support generic in JDK5.
Pratically are not deprecated, but there are other classes more appropriate.
Legacy = heritage of old java version.
Early versions of java did not include Collections framework. Instead it defined several classes and one interface to store objects. When collection came these classes reengineered to support the Collection interfaces. These old classes are known are legacy classes. Vector is one of them. Others are Dictionary,HashTable,Properties, Stack
In this context, legacy means "should not be used anymore in new code". But you can if you want. And as they are not deprecated yet, they will be there for now at least.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With