collections in java

Solutions on MaxInterview for collections in java by the best coders in the world

showing results for - "collections in java"
Alexander
23 Sep 2019
1Any group of individual objects which are represented as a single unit is known as the collection of the objects. In Java, a separate framework named the “Collection Framework” has been defined in JDK 1.2 which holds all the collection classes and interface in it.
Kristian
10 Nov 2018
1When to use List, Set and Map?
2If we need to access elements frequently by using index, then List is a way 
3to go ArrayList provides faster access if we know index.
4If we want to store elements and want them to maintain an order, 
5then go for List again. List is an ordered collection and maintain order.
6If we want to create collection of unique elements and don't want
7any duplicate than choose any Set implementation. (HashSet... )
8If we want store data in form Key and Value than Map is the way to go.
9We can choose from HashMap, Hashtable...