click below
click below
Normal Size Small Size show me how
oop module 10
gawa ni jear na baliw
| Question | Answer |
|---|---|
| is the root interface for all the collection classes. The Collection interface extends the Iterable interface and therefore all the subclasses of Collection interface also implement the | iterable interface |
| implemented by all the classes in the collection framework. It declares the methods that every collection will have. In other words, we can say that the Collection interface builds the foundation on which the collection framework depends. | Collection Interface |
| is the child interface of Collection interface. It inhibits a list type data structure in which we can store the ordered collection of objects. It can have duplicate values. | List Interface |
| what class implements the List interface. It uses a dynamic ____to store the duplicate element of different data types. The ______ class maintains the insertion order and is non-synchronized. The elements stored in the _____ | array list |
| It uses a doubly linked list internally to store the elements. It can store the duplicate elements. It maintains the insertion order and is not synchronized. In __, the manipulation is fast because no shifting is required. | LinkedList |
| uses a dynamic array to store the data elements. It is similar to ArrayList. However, It is synchronized and contains many methods that are not the part of Collection framework. | Vector |
| . It implements the last-in-first-out data structure, | Stack |
| maintains the first-in-first-out order. It can be defined as an ordered list that is used to hold the elements which are about to be processed | Queue Interface |
| The PriorityQueue class implements the Queue interface. It holds the elements or objects which are to be processed by their priorities | PriorityQueue |
| , we can remove and add the elements from both the side. ____ stands for a double-ended queue which enables us to perform the operations at both the ends. | Deque Interface |
| ____class implements the Deque interface. It facilitates us to use the Deque. Unlike queue, we can add or delete the elements from both the ends. _____is faster than ArrayList and Stack and has no capacity restrictions | ArrayDeque |
| represents the unordered set of elements which doesn't allow us to store the duplicate items. We can store at most one null value in Set. Set is implemented by HashSet, LinkedHashSet, and TreeSet. | Set Interface |
| It represents the collection that uses a hash table for storage. Hashing is used to store the elements in the HashSet. It contains unique items. | Hashset |
| represents the LinkedList implementation of Set Interface. It extends the HashSet class and implements Set interface. Like HashSet, It also contains unique elements. It maintains the insertion order and permits null elements. | Linked Hashset |
| the alternate of Set interface that provides a total ordering on its elements. The elements of the ____are arranged in the increasing (ascending) order. The _____ provides the additional methods that inhibit the natural ordering of the elements. | SortedSet Interface |
| uses a tree for storage. Like HashSet, ____also contains unique elements. However, the access and retrieval time of ____is quite fast. The elements in _____stored in ascending order. | TreeSe |
| public boolean add(E e) | Inserts an element into the collection. |
| public boolean addAll(Collection<? extends E> c) | Inserts the specified collection elements into the invoking collection. |
| public boolean remove(Object element) | Deletes an element from the collection. |
| public boolean removeAll(Collection<?> c) | Deletes all the elements of the specified collection from the invoking collection. |
| default boolean removeIf(Predicate<? super E> filter) | Deletes all the elements of the collection that satisfy the specified predicate. |
| public boolean retainAll(Collection<?> c) | Deletes all the elements of invoking collection except the specified collection. |
| public int size() | Returns the total number of elements in the collection. |
| public void clear() | Removes the total number of elements from the collection. |
| public boolean contains(Object element) | Searches for an element in the collection. |
| public boolean containsAll(Collection<?> c) | Searches the specified collection in the collection. |
| public Iterator iterator() | Returns an iterator. |
| public Object[] toArray() | Converts collection into array. |
| public <T> T[] toArray(T[] a) | Converts collection into array of the specified runtime type. |
| public boolean isEmpty() | Checks if collection is empty. |
| default Stream<E> parallelStream() | Returns a possibly parallel Stream with the collection as its source. |
| default Stream<E> stream() | Returns a sequential Stream with the collection as its source. |
| default Spliterator<E> spliterator() | Generates a Spliterator over the elements in the collection. |
| public boolean equals(Object element) | Matches two collections. |
| public int hashCode() | Returns the hash code number of the collection. |