
Domains
Agile Management
Master Agile methodologies for efficient and timely project delivery.
View All Agile Management Coursesicon-refresh-cwCertifications
Scrum Alliance
16 Hours
Best Seller
Certified ScrumMaster (CSM) CertificationScrum Alliance
16 Hours
Best Seller
Certified Scrum Product Owner (CSPO) CertificationScaled Agile
16 Hours
Trending
Leading SAFe 6.0 CertificationScrum.org
16 Hours
Professional Scrum Master (PSM) CertificationScaled Agile
16 Hours
SAFe 6.0 Scrum Master (SSM) CertificationAdvanced Certifications
Scaled Agile, Inc.
32 Hours
Recommended
Implementing SAFe 6.0 (SPC) CertificationScaled Agile, Inc.
24 Hours
SAFe 6.0 Release Train Engineer (RTE) CertificationScaled Agile, Inc.
16 Hours
Trending
SAFe® 6.0 Product Owner/Product Manager (POPM)IC Agile
24 Hours
ICP Agile Certified Coaching (ICP-ACC)Scrum.org
16 Hours
Professional Scrum Product Owner I (PSPO I) TrainingMasters
32 Hours
Trending
Agile Management Master's Program32 Hours
Agile Excellence Master's ProgramOn-Demand Courses
Agile and ScrumRoles
Scrum MasterTech Courses and Bootcamps
Full Stack Developer BootcampAccreditation Bodies
Scrum AllianceTop Resources
Scrum TutorialProject Management
Gain expert skills to lead projects to success and timely completion.
View All Project Management Coursesicon-standCertifications
PMI
36 Hours
Best Seller
Project Management Professional (PMP) CertificationAxelos
32 Hours
PRINCE2 Foundation & Practitioner CertificationAxelos
16 Hours
PRINCE2 Foundation CertificationAxelos
16 Hours
PRINCE2 Practitioner CertificationSkills
Change ManagementMasters
Job Oriented
45 Hours
Trending
Project Management Master's ProgramUniversity Programs
45 Hours
Trending
Project Management Master's ProgramOn-Demand Courses
PRINCE2 Practitioner CourseRoles
Project ManagerAccreditation Bodies
PMITop Resources
Theories of MotivationCloud Computing
Learn to harness the cloud to deliver computing resources efficiently.
View All Cloud Computing Coursesicon-cloud-snowingCertifications
AWS
32 Hours
Best Seller
AWS Certified Solutions Architect - AssociateAWS
32 Hours
AWS Cloud Practitioner CertificationAWS
24 Hours
AWS DevOps CertificationMicrosoft
16 Hours
Azure Fundamentals CertificationMicrosoft
24 Hours
Best Seller
Azure Administrator CertificationMicrosoft
45 Hours
Recommended
Azure Data Engineer CertificationMicrosoft
32 Hours
Azure Solution Architect CertificationMicrosoft
40 Hours
Azure DevOps CertificationAWS
24 Hours
Systems Operations on AWS Certification TrainingAWS
24 Hours
Developing on AWSMasters
Job Oriented
48 Hours
New
AWS Cloud Architect Masters ProgramBootcamps
Career Kickstarter
100 Hours
Trending
Cloud Engineer BootcampRoles
Cloud EngineerOn-Demand Courses
AWS Certified Developer Associate - Complete GuideAuthorized Partners of
AWSTop Resources
Scrum TutorialIT Service Management
Understand how to plan, design, and optimize IT services efficiently.
View All DevOps Coursesicon-git-commitCertifications
Axelos
16 Hours
Best Seller
ITIL 4 Foundation CertificationAxelos
16 Hours
ITIL Practitioner CertificationPeopleCert
16 Hours
ISO 14001 Foundation CertificationPeopleCert
16 Hours
ISO 20000 CertificationPeopleCert
24 Hours
ISO 27000 Foundation CertificationAxelos
24 Hours
ITIL 4 Specialist: Create, Deliver and Support TrainingAxelos
24 Hours
ITIL 4 Specialist: Drive Stakeholder Value TrainingAxelos
16 Hours
ITIL 4 Strategist Direct, Plan and Improve TrainingOn-Demand Courses
ITIL 4 Specialist: Create, Deliver and Support ExamTop Resources
ITIL Practice TestData Science
Unlock valuable insights from data with advanced analytics.
View All Data Science Coursesicon-dataBootcamps
Job Oriented
6 Months
Trending
Data Science BootcampJob Oriented
289 Hours
Data Engineer BootcampJob Oriented
6 Months
Data Analyst BootcampJob Oriented
288 Hours
New
AI Engineer BootcampSkills
Data Science with PythonRoles
Data ScientistOn-Demand Courses
Data Analysis Using ExcelTop Resources
Machine Learning TutorialDevOps
Automate and streamline the delivery of products and services.
View All DevOps Coursesicon-terminal-squareCertifications
DevOps Institute
16 Hours
Best Seller
DevOps Foundation CertificationCNCF
32 Hours
New
Certified Kubernetes AdministratorDevops Institute
16 Hours
Devops LeaderSkills
KubernetesRoles
DevOps EngineerOn-Demand Courses
CI/CD with Jenkins XGlobal Accreditations
DevOps InstituteTop Resources
Top DevOps ProjectsBI And Visualization
Understand how to transform data into actionable, measurable insights.
View All BI And Visualization Coursesicon-microscopeBI and Visualization Tools
Certification
24 Hours
Recommended
Tableau CertificationCertification
24 Hours
Data Visualization with Tableau CertificationMicrosoft
24 Hours
Best Seller
Microsoft Power BI CertificationTIBCO
36 Hours
TIBCO Spotfire TrainingCertification
30 Hours
Data Visualization with QlikView CertificationCertification
16 Hours
Sisense BI CertificationOn-Demand Courses
Data Visualization Using Tableau TrainingTop Resources
Python Data Viz LibsCyber Security
Understand how to protect data and systems from threats or disasters.
View All Cyber Security Coursesicon-refresh-cwCertifications
CompTIA
40 Hours
Best Seller
CompTIA Security+EC-Council
40 Hours
Certified Ethical Hacker (CEH v12) CertificationISACA
22 Hours
Certified Information Systems Auditor (CISA) CertificationISACA
40 Hours
Certified Information Security Manager (CISM) Certification(ISC)²
40 Hours
Certified Information Systems Security Professional (CISSP)(ISC)²
40 Hours
Certified Cloud Security Professional (CCSP) Certification16 Hours
Certified Information Privacy Professional - Europe (CIPP-E) CertificationISACA
16 Hours
COBIT5 Foundation16 Hours
Payment Card Industry Security Standards (PCI-DSS) CertificationOn-Demand Courses
CISSPTop Resources
Laptops for IT SecurityWeb Development
Learn to create user-friendly, fast, and dynamic web applications.
View All Web Development Coursesicon-codeBootcamps
Career Kickstarter
6 Months
Best Seller
Full-Stack Developer BootcampJob Oriented
3 Months
Best Seller
UI/UX Design BootcampEnterprise Recommended
6 Months
Java Full Stack Developer BootcampCareer Kickstarter
490+ Hours
Front-End Development BootcampCareer Accelerator
4 Months
Backend Development Bootcamp (Node JS)Skills
ReactOn-Demand Courses
Angular TrainingTop Resources
Top HTML ProjectsBlockchain
Understand how transactions and databases work in blockchain technology.
View All Blockchain Coursesicon-stop-squareBlockchain Certifications
40 Hours
Blockchain Professional Certification32 Hours
Blockchain Solutions Architect Certification32 Hours
Blockchain Security Engineer Certification24 Hours
Blockchain Quality Engineer Certification5+ Hours
Blockchain 101 CertificationOn-Demand Courses
NFT Essentials 101: A Beginner's GuideTop Resources
Blockchain Interview QsProgramming
Learn to code efficiently and design software that solves problems.
View All Programming Coursesicon-codeSkills
Python CertificationInterview Prep
Career Accelerator
3 Months
Software Engineer Interview PrepOn-Demand Courses
Data Structures and Algorithms with JavaScriptTop Resources
Python TutorialThe Java Collection is an architectural framework for storing and manipulating the group of objects.
Advantages of Collection Framework in Java:
The java.util package includes all the Collection Framework classes and interfaces.
The distinction between the Set and Map interface is that we only have keys in Set, whereas key, value pairs are available in Map.

Iterator interface in Java
Iterator interface only offers the ability to iterate the collection elements forward.
Methods of Iterator Interface
The Iterator interface has only 3 methods.
Method | Description |
|---|---|
public Object next() | It returns the current element and moves the cursor pointer to the next element in collection object. |
public boolean hasNext() | It returns true if the iterator has next element else it is false. |
public void remove() | It removes the iterator's last returned element. |
Iterable Interface
The Iterable interface for all collection classes is the root interface. The interface of collection extends the Iterable interface and thus all subclasses of the interface of collection also implement the Iterable interface.
List Interface in Java
List interface is the Collection interface child. It inhibits a data structure of the list type in which we can store ordered object collection. It can have values duplicated.
The ArrayList, LinkedList, Vector, and Stack classes are implementing the List interface.
To instantiate the List interface, we must use:
List <data-type> listType1= new ArrayList<data-type> ();
List <data-type> listType2 = new LinkedList<data-type>();
List <data-type> listType3 = new Vector<data-type> ();
List <data-type> listType4 = new Stack<data-type>();
In the List interface, there are different methods that can be used to insert, delete and access the elements from the list.
Below are the classes that implement the interface of the List.
ArrayList
The List interface is implemented by the ArrayList class. It utilizes a dynamic array to store various kinds of information duplicate elements. The class ArrayList retains the order of insertion and is not synchronized. It is possible to access randomly the elements stored in the ArrayList class.
Take the instance below.
import java.util.*;
class TestJavaArrayList{
public static void main(String args[]){
ArrayList<String> myList=new ArrayList<String>();
myList.add("Ashish");
myList.add("Rahul");
myList.add("Shivam");
myList.add("Montu");
Iterator itr= myList.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Output of above program:
Ashish
Rahul
Shivam
Montu
LinkedList
The Collection interface is implemented by LinkedList. It internally utilizes a dual-linked list to store the elements. The duplicate elements can be stored. It keeps the order of insertion and is not synchronized. The manipulation is quick in LinkedList because no shifting is necessary.
Take the instance below.
import java.util.*;
publicclass TestJavaLinkedList{
public static void main(String args[]){
LinkedList<String> linkedList =new LinkedList<String>();
linkedList.add("Ashish");
linkedList.add("Rahul");
linkedList.add("Shivam");
linkedList.add("Montu");
Iterator<String> itr= linkedList.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Output:
Ashish
Rahul
Shivam
Montu
Vector
To store the information elements, the Vector utilizes a dynamic array. It's ArrayList-like. It is synchronized, however, and includes many methods that are not part of the framework for collection.
Take the instance below.
import java.util.*;
publicclass TestJavaCollection3{
public static void main(String args[]){
Vector<String> myVector=new Vector<String>();
myVector.add("Sneha");
myVector.add("Priya");
myVector.add("Sonia");
myVector.add("Preeti");
Iterator<String> itr= myVector.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Output:
Sneha
Priya
Sonia
Preeti
Stack
The stack is Vector's subclass. It uses the data structure of the last-in-first-out, i.e. Stack. The stack includes all Vector class methods and also offers its techniques such as boolean push), (boolean peek), (boolean push(object o) defining its characteristics.
Take the instance below.
import java.util.*;
publicclass TestJavaCollection4{
public static void main(String args[]){
Stack<String> myStack = new Stack<String>();
myStack.push("Ashish");
myStack.push("Priya");
myStack.push("Mohan");
myStack.push("Sneha");
myStack.push("Kangana");
myStack.pop();
Iterator<String> itr= myStack.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Output:
Ashish
Priya
Mohan
Sneha
Queue Interface in Java
Queue interface keeps the first-in-first-out order. It can be described as an ordered list used to keep the processed elements. There are different classes that implement the Queue interface, such as PriorityQueue, Deque, and ArrayDeque.
Take the instance below.
Queue<Integer> queue1 = new PriorityQueue<Integer>();
Queue<Integer> queue2 = new ArrayDeque<Integer>();
PriorityQueue
The Queue interface is implemented by the PriorityQueue class. It contains the components or items to be processed according to their priorities. PriorityQueue does not permit the storage of null values in the queue.
Take the instance below.
import java.util.*;
publicclass TestJavaQueue{
public static void main(String args[]){
PriorityQueue<String> myQueue=new PriorityQueue<String>();
myQueue.add("Ashish ");
myQueue.add("Vijay Raj");
myQueue.add("JaiShankar");
myQueue.add("Raj");
System.out.println("Head element:"+ myQueue.element());
System.out.println("Head element:"+ myQueue.peek());
System.out.println("iterating the queue elements:");
Iterator itr= myQueue.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
myQueue.remove();
myQueue.poll();
System.out.println("after removing 2 elements:");
Iterator<String> itr2=queue.iterator();
while(itr2.hasNext()){
System.out.println(itr2.next());
}
}
}
Output:
Head element:Ashish
Head element:Ashish
iterating the queue elements:
Ashish
Raj
JaiShankar
Vijay Raj
after removing 2 elements:
JaiShankar
Vijay Raj
Deque Interface
Deque interface expands the interface to the queue. We can delete and add the components from both sides in Deque. Deque is a double-ended queue that allows us to execute both ends of the activities.
Take the instance below.
Deque deque = new ArrayDeque();
ArrayDeque
The Deque interface is implemented by the ArrayDeque class. It makes it easier for us to use the Deque. Unlike queue, from both ends we can add or delete the components. ArrayDeque is quicker than ArrayList and Stack and has no limitations on capability. Take the instance below.
import java.util.*;
publicclass TestJavaQueue{
public static void main(String[] args) {
Deque<String> myDeque = new ArrayDeque<String>();
myDeque.add("Priya");
myDeque.add("Sonia");
myDeque.add("Rahul");
for (String str : myDeque) {
System.out.println(str);
}
}
}
Output:
Priya
Sonia
Rahul
Set Interface in Java
The Java Set Interface package includes java.util. It expands the interface for the collection. It represents the unordered set of elements that do not allow the duplicate items to be stored. We can store a null value in Set as much as possible. HashSet, LinkedHashSet, and TreeSet implements the set.
Take the instance below.
Set<data-type> set1 = new HashSet<data-type>();
Set<data-type> set2 = new LinkedHashSet<data-type>();
Set<data-type> set3 = new TreeSet<data-type>();
HashSet
Class HashSet implements Interface Set. It is the set that utilizes a storage hash table. Hashing is used to store HashSet components. It includes distinctive elements.
Take the instance below.
import java.util.*;
publicclass TestJavaSet{
public static void main(String args[]){
HashSet<String> mySet=new HashSet<String>();
mySet.add("Ashish");
mySet.add("Priya");
mySet.add("Hemu");
Iterator<String> itr= Myset.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Output:
Ashish
Priya
Hemu
LinkedHashSet
LinkedHashSet class reflects Set Interface's LinkedList application. It expands the class of HashSet and implements the interface set. It also includes distinctive components such as HashSet. It keeps the order of insertion and allows null components.
Take the instance below.
import java.util.*;
publicclass TestJavaSet{
public static void main(String args[]){
LinkedHashSet<String> Myset=new LinkedHashSet<String>();
Myset.add("Sonia");
Myset.add("Kangana");
Myset.add("Hemu");
Iterator<String> itr= Myset.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Output:
Sonia
Kangana
Hemu
SortedSet Interface
SortedSet is the alternate of a Set interface that provides a total ordering on its elements. The elements of the SortedSet are arranged in the increasing (ascending) order. The SortedSet provides additional methods that inhibit the natural ordering of the elements.
Take the instance below.
SortedSet<data-type> set = new TreeSet data-type>();
TreeSet
SortedSet is the Set interface alternative that offers a complete ordering of its components. The SortedSet components are arranged in the rising (ascending) order. The SortedSet offers extra methods that inhibit the elements ' natural order.
Take the instance below.
import java.util.*;
publicclass TestJavaSet{
public static void main(String args[]){
TreeSet<String> mySet=new TreeSet<String>();
mySet.add("Raju");
mySet.add("Vijay");
mySet.add("Ashish");
Iterator<String> itr= mySet.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Output:
Ashish
Raju
Vijay