Tag Archives: Interview question of collection

What is WeakHashMap in Java?

What is WeakHashMap in Java?

  What is WeakHashMap in Java? It is exactly same as HashMap except for the following difference:- In the case of HashMap even though object doesn’t have any reference it is not eligible for GC. If it is associated with HashMap that is HashMap dominates Garbage collector. But in the case of WeakHashMap, if the object doesn’t contain any references ...

Read More »

Difference between ArrayList and LinkedList in Java?

Difference between ArrayList and LinkedList in Java?

  Difference between ArrayList and LinkedList in Java? The underlying data structure is double LinkedList. Insertion order is preserved. Duplicate objects are allowed. Heterogeneous object allowed. Null insertion is possible. LinkedList implements Serializable and Cloneable interface but not RandomAccess LinkedList is the best choice if our frequent operation is insertion or deletion in the middle. LinkedList is worst choice if ...

Read More »

Explain ArrayList and difference between ArrayList and Vector?

Explain ArrayList and difference between ArrayList and Vector?

Explain ArrayList and difference between ArrayList and Vector? ArrayList is a class, that uses a dynamic array for storing the elements. It extends AbstractList class and implements List interface. The underlying data structure is a Resizable array or growable array. Duplicates are allowed. Insertion order is preserved. Heterogeneous objects are allowed(except TreeSet and TreeMap everywhere Heterogeneous objects are allowed) Null ...

Read More »

What is a Collection Framework in Java?

What is a Collection Framework in Java?

What is a Collection Framework in Java? If we want to represent a group of an individual object as a single entity then we should go for collection. It contains several classes and interfaces which can be used to represent a group of an individual object as a single entity. You can perform following activity using Java collection framework, Add objects to ...

Read More »

Responsive WordPress Theme Freetheme wordpress magazine responsive freetheme wordpress news responsive freeWORDPRESS PLUGIN PREMIUM FREEDownload theme free