Monday, 7 January 2013

What are the Legacy classes?

Leave a Comment
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 re-engineered to support the Collection interfaces. These old classes are known are legacy classes.
Legacy classes-Dictionary,HashTable,Properties, Stack, Vector
Legacy interface- Enumeration.

• Enumeration ---Interface
• Dictonary ------Abstract class
• Hashtable -----Concrete class
• Properties -----Concrete class
• Vector -----Concrete class
• Stack -----Concrete class

Only values- Stack, Vector
Key/value pair – Dictionary, HashTable, Properties

Enumeration interface:
It defines the method by which we can enumerate(obtain one at a time) through the elements. The legacy interface is suppressed by Iterator.
It has two methods:
Boolean hasMoreElements()


Post a Comment