Interfaces of collection framework

9 key interfaces of collection framework:  1. Collection Interface : If we want to represent a group of individual objects as a single entity then we should go for collection. Collection interface defines the most common methods which are applicable for any collection object. For ex:- Add Object Remove Object Contains() In general collection interface Read More…




Java Vector Class

Vector Class :  The underlying datastructure is resizable array or growable array.  Insertion order is preserved.  Duplicates objects are allowed.  Heterogeneous objects are allowed.  Null insertion is possible.  Vector implements Serializable, Cloneable interfaces and Random Access interfaces.  Vector is the best choice if our frequent operation is retrieval.  Linked List is the worst choice if Read More…


Difference between ArrayList and LinkedList

Difference between ArrayList and LinkedList is important interview question for Fresher and 2-3 years of experience (JAVA, android or other programming languages) ArrayList LinkedList 1. It is the best choice if our frequent operation is retrieval. 1. It is the best choice if our frequent operation is insertion and deletion in the middle. 2. ArrayList Read More…


Java LinkedList class

LinkedList class :  The underlying datastructure is Double Linked List.  Insertion order is preserved.  Duplicates are allowed.  Heterogeneous objects are allowed.  Null insertion is possible.  Linked List implements serializable and cloneable interfaces but not Random Access interfaces.  Linked List is the best choice if our frequent operation is insertion or deletion in the middle.  Linked Read More…


Java ArrayList class

ArrayList class :  Resizable Array or growable array.  The underlined datastructure resizable and growable array.  Duplicates are allowed.  Insertion order is preserved.  Heterogeneous objects are allowed(Except Tree Set and Tree Map everywhere heterogeneous objects are allowed).  Null insertion is possible. CONSTRUCTOR: ArrayList l = new ArrayList():- Creates an empty ArrayList object with default initial capacity Read More…


Difference between ArrayList and Vector in JAVA

ArrayList and Vector both implements List interface and maintains insertion order. ArrayList Vector 1. Every method present in ArrayList is non-synchronized. 1. Every method present in ArrayList is synchronized. 2. At a time multiple threads are allowed to operate on ArrayList object and hence ArrayList is not thread safe. 2. At a time only one Read More…


What is the need of Collection Framework in JAVA?

Why need of Collection in java? In simple words, the Java Collections Framework allows you to use the right data structure because one size does not fit all. Java Collections is come up with different functionality, convenience, and usability. We have two approaches: Individual variable approach: Array Individual variable approach: Suppose we want to create or store Read More…