Generic Collection Framework (JDK 5) by Examples Example 1: List ( List of Strings) Implemented by ArrayList The classes and interfaces for the Collection Framework are kept in package java.util. You need to refer to the JDK API specification while reading this chapter. Auto-Boxing and Auto-Unboxing between primitive types and their wrapper classes.You also need to be familar with these concepts introduced in JDK 5: See " Inheritance, Substitution, Polymorphism and Type Casting" for a quick summary. Inheritance and Polymorphism, especially the upcasting and downcasting operations.Interfaces, abstract methods and their implementations.To understand this chapter, you have to be familiar with: The collection framework is retrofitted to support generics and takes full advantages of these new features. JDK 5 introduced Generics (which supports passing of types), and many related features (such as auto-boxing/auto-unboxing and for-each loop). JDK 1.2 introduced the unified collection framework, and retrofits the legacy classes ( Vector and Hashtable) to conform to this unified collection framework. Prior to JDK 1.2, Java's data structures consist of array, Vector, and Hashtable that were designed in a non-unified way with inconsistent public interfaces. Similar Collection Framework is the C++ Standard Template Library (STL).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |