Collections class Methods in Java Part -I

java.util.Collections

This class consists exclusively of static methods that operate on or return collections. This class is a member of the Java Collections Framework.


Some Methods of Collections class.


Collections.addAll(Collection, E...): his method adds all of the specified element to the specified collection.


Collections.asLifoQueue(Deque): This method returns a view of a Deque as a Last-in-first-out (Lifo) Queue.


Collections.binarySearch(List, E): This method searches the specified list for the specified object using the binary search algorithm.


Collections.binarySearch(List, E, Comparator): This method searches the specified list for the specified object using the binary search algorithm.


Collections.checkedCollection(Collection, Class): This method returns a dynamical type safe view of the specified collection.


Collections.checkedList(List, Class): This method returns a dynamical type safe view of the specified list.


Collections.checkedMap(Map, Class, Class): This method returns a dynamical type safe view of the specified map.


Collections.checkedNavigableMap(NavigableMap, Class, Class): This method returns a dynamically typesafe view of the specified navigable map.


Collections.checkedNavigableSet(NavigableSet, Class): This method returns a dynamically typesafe view of the specified navigable set.


Collections.checkedQueue(Queue, Class): This method returns a dynamically typesafe view of the specified queue.


Collections.checkedSet(Set, Class): This method returns a dynamically typesafe view of the specified set.


Collections.checkedSortedMap(SortedMap, Class, Class): This method returns a dynamically typesafe view of the specified sorted map.


Collections.checkedSortedSet(SortedSet, Class): This method returns a dynamically typesafe view of the specified sorted set.


Collections.copy(List, List):  This method copies all of the elements from one list into another.


Collections.disjoint(Collection, Collection): This method returns true if the two specified collections have no elements in common.


Collections.emptyEnumeration(): This method returns an enumeration that has no elements.


Collections.emptyIterator(): This method returns an iterator that has no elements.


Collections.emptyList(): This method returns an empty list.


Collections.emptyListIterator(): This method returns a list iterator that has no elements.


Collections.emptyMap(): This method returns an empty map.


Some more Methods of Collections class Part -II


Some more Methods of Collections class Part -III



No comments:

Post a Comment