What is Collection?
![]() |
collection of items |
--> A Group is called Collection.
--> Collections is a framework of java technology.
--> Collections help the Developer to collect objects and store them into one object. By storing into one object, we can manipulate all objects by accessing only one object.
--> Collections contain so many inbuilt classes and interfaces, this all is in java.util package.
Why it is required?
--> We have Array, Vector and Hashtable to store the objects and we can also make the array of objects but each data structures have its own different methods to access elements, so it is difficult for the Developers to remember and implements it.
--> All this has no common interface. Collection framework provides these facilities. Collection framework gives the programmer to use prepackaged data structures.
--> Collection framework appeared in java 1.2 first time.
What Collections include?
Collection Hierarchy |
--> Here Iterable, Collection, List, Queue and Set are the Interfaces.
--> ArrayList, LinkedList, Vector, ArrayDeque, and HashSet are the Classes of Collection framework.
--> Vector and HashTable were modified and added to Collection framework.
Advantages of Collections
--> All Interfaces and classes which are part of the Collection have some common methods.
--> It reduces the programming effort, programmer doesn't have to worry about the architecture of the data structure but he just needs to implement.
Subscribe by Email
Follow Updates Articles from This Blog via Email
No Comments
Please comment here...