List method removeAll() in Java
A list method removeAll() used to remove all of its elements in the specified collection from this list, if exists. It returns boolean value true, if this list changed, otherwise false. If specified collection is empty, it returns false.
List method addAll() in Java
A List method addAll() used to append the specified collection elements at the end of this list, in order in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. It returns a boolean value true, if this list is changed, otherwise false.
List method containsAll() in Java
A list method containsAll() used to determine whether all specified elements are present in the list. It returns boolean value true, if all specified collection elements are present in the list, otherwise false.
List method remove() in Java
A list method remove() used to remove an element from the list if present. If a list includes multiple occurrence of the specified element, it removes the first occurrence of the matching element. If list does not include specified element, it remains unchanged. It returns boolean value true, if list includes specified element and list elements changed, otherwise false.
List method toArray() with array as parameter in Java
A List method toArray() with specified array used to copy a list elements into the specified array that includes all the elements of the list. If the list elements fits in the specified array, it is returned an array that incudes a list elements. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.
List method toArray() in Java
A List method toArray() used to convert a list elements to an Object array that includes all the elements in this list in the exact sequence (from first to last element). It returns an array of objects that includes all list elements.
List method iterator() in Java
A List method iterator() used to convert an iterator from the list that allows to iterate elements sequentially. It returns an iterator over the elements in this list in proper sequence. It allows to modify the list while iterating using iterator.
List method contains() in Java
A List method contains() used to determine whether a specified object present in the list. It returns boolean value true, if specified object present in the list, otherwise false. It uses a list method equals() internally to determine whether object presents in the list.
List method isEmpty() in Java
A list method isEmpty() method used to determine whether a list is empty or it includes an elements. It returns boolean value true, if list does not includes any elements or size of list is 0, otherwise returns false.
List method size() in Java
A List method size() used to determine the size of list that represents a number of elements present in the list. It starts counting from 1. It returns an integer that represents a number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
Privacy Policy
Terms of Service
Disclaimer
Contact us
About us