Java Collections Framework, first introduced with the Java 2 platform, Standard Edition, version 1.2. The collections framework in Java provides a well-defined set of interfaces and classes for storing and manipulating groups of data as a single unit or collection. The framework provides convenient API to deal with common forms of data structure li...

Read More

Now let's take a look at the key classes and interfaces provided by the Java collections framework: Collection Interface This is the root of the collection hierarchy. A collection represents a group of objects known as its elements. The Java platform doesn’t provide any direct implementations of this interface. Set Interface A collection that conta...

Read More

The key interfaces used by the collections framework are List, Set and Map. The List and Set extends the Collection interface. Be couscous about Collection interface with the Collections class. Collections is a utility class. Following are the collection interfaces and their concrete implementations. Set  (HashSet , TreeSet) : A Set is a collection...

Read More

There are 2 utility classes for performing various operations like searching, sorting, shuffling and immutability on Collection Objects. These classes are java.util.Collections class and java.util.Arrays class.  Majority of these implementations are provided via static factory methods. This classes are non-instantiate able by providing private cons...

Read More

Collection Interface New Class Usage Arguments & Additional Methods List is an ordered collection of objects. (has a positional index),so it can have duplicate objects. List overloads add() with add(int, Object) and addAll( collectionC ) to insert objects at the specified index. ArrayList extends AbstractList for a resizable Random Access array tha...

Read More

Collection is an interface that specifies a group of objects known as elements. The details of how the group of elements is maintained is left up to the concrete implementations of Collection. For example, some Collection implementations like List allow duplicate elements whereas other implementations like Set don't. A lot of the Collection impleme...

Read More

The java.util.Vector class implements List interface and it is a grow able array of objects. It contains components that can be accessed using an integer index. Following are the important points about Vector: It is an implementation class of List interface. The underlying data structure of Vector is a resizable or growable array. Duplicate Objects...

Read More

1. What is difference between HashMap and Hashtable ?   Read Differences between HashMap and Hashtable here →  2. Differences between Comparable and Comparator?   Read all about Comparable and Comparator here →  3. How can we sort a list of Objects?   How to sort an Array of Person objects using Comparable    How to sort an ArrayList of Person obje...

Read More

PriorityQueue : PriorityQueue has been introduced in JDK1.5 .This class implements Queue interface and  maintains ordering of elements either on basis of natural ordering(Comparable) or Comparator provided. Here we will see an example of PriorityQueue in java. PriorityQueue fetches lowest or highest priority element from the head of the queue. Inte...

Read More

FOLLOW US ON LinkedIn



Explore Tutu'rself