Java has a very huge variety of feature one of which is Collection interfaces.
Java has a rich Collection interfaces and Classes to use for the developer community. And now a days these collections are very much helpful to the developers for the storing multiple data.
Collection is something like the array but it is too different from the array. Main difference is array stores only one type of data in whole array, like if array is type of integer we can store only numeric values in it where as in a particular collection object we can store any type of data at a time.
Collection enables us to work with the group of objects.
Collection framework have main 3 types of interface
From the above image we can see that root of Set and List interface is Collection interface. A Map is separate interface but it is to be in the collection framework.
There are some of the common method which is in Collection interface which we can use in all the sub interfaces of the collections. Methods are listed below:
Java has a rich Collection interfaces and Classes to use for the developer community. And now a days these collections are very much helpful to the developers for the storing multiple data.
Collection is something like the array but it is too different from the array. Main difference is array stores only one type of data in whole array, like if array is type of integer we can store only numeric values in it where as in a particular collection object we can store any type of data at a time.
Collection enables us to work with the group of objects.
Collection framework have main 3 types of interface
- List
- Set
- Map
From the above image we can see that root of Set and List interface is Collection interface. A Map is separate interface but it is to be in the collection framework.
There are some of the common method which is in Collection interface which we can use in all the sub interfaces of the collections. Methods are listed below:
- add()
- addAll()
- clear()
- iterator()
- remove()
- removeAll()
- size()
No comments:
Post a Comment