what are the legacy classes in Java?
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
?
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.
链接地址: http://www.djcxy.com/p/2680.html上一篇: Java内部类和静态嵌套类
下一篇: Java中的遗留类是什么?