If any object is collection of hetrogeneous objects or elements is known as collection object.
Every collection object can be derived from a special class called collection class.
collection of collection classes is known as collection framework.
In java language all collection classes are existing as predefined package in java.util package.
The main aim of collection framework is to manage the data very efficiently in the memory( managing data represents searching the data, sorting data etc..)
Note:In java language data structure (managing the data in the memory) can be achieved by collection framework.
In java language collection framework mainly depends on following interfaces.
- List Interface
- Set Interface
- Map Interface
it is a predefined interface in java.util package. It accepts duplicate data in the memory. which was implemented following collection classes.
- Array List
- Linked List etc...
objects of above collection calsses accepts hetrogeneous data.
it is a predefined interface in java.util package. It accepts unique data in the memory. which was implemented following collection classes.
it is a predefined interface in java.util package. It accepts elements in the form of key value pair(key allows unique elements where as value allows duplicate elements). which was implemented following collection classes.
All the collection classes are existing as templete of generic classes.In java.util package to allocate
sufficient memory space we must create an object for any collection class with the following syntax
collectionclass<wrapperclass> objref=new collectionclass<wrapperclass>();
In the above syntax based on wrapper class is allocates sufficient memory for that related element.
Stack<Integer> objref=new Stack<Integer>();
In the above example stack can be accept only integer elsements.
Stack<String> objref=new Stack<String>();
In the above example stack can be accept only String elsements.
Templete or Generic:
it is a common structure for an element or object, If any class is common to multiple object known as tmplete class or generic class.