Posts

Java Collections – Interface, List, Queue, Sets in Java with Examples

  The collection in Java is a framework that offers an architecture to store and manipulate a group of objects. Java Collections are used to achieve all the operations to perform the data with operations like searching, insertion, sorting, manipulation, and deletion. Java Collection is known as a single unit of objects and it provides interfaces like Sets, List, Queue, and Dequeue along with classes such as Array List, Vector, Linked List, Priority Queue, HashSet, LinkedhashSet, and TreeSet. In this blog, we are going to see List, Queue, Sets of Interfaces with example programs. The collection framework is in java.util package along with classes and interfaces. The hierarchy of collection framework Methods of Collection Interface Following are the methods that can be declared in the Collection Interface. Sl.No Method Description 1 public boolean add(E e) To insert an element 2 public boolean addAll(Collection<? extends E> c) To insert the specified collection elements 3 publi...