0% found this document useful (0 votes)
6 views10 pages

Java Collections Framework Overview

Uploaded by

shobanam140
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views10 pages

Java Collections Framework Overview

Uploaded by

shobanam140
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Java Collections Framework

Introduction to Collections
• Group of objects stored as single entity
• Provides better data manipulation than arrays
Collection Interfaces
• List: Ordered, allows duplicates
• Set: No duplicates
• Queue: FIFO principle
• Map: Key-value pairs
ArrayList
• ArrayList<String> list = new ArrayList<>();
• [Link]("Java"); [Link]("Python");
LinkedList
• Faster insertions/deletions than ArrayList
• LinkedList<Integer> ll = new LinkedList<>();
HashSet
• No duplicates, unordered
• HashSet<String> set = new HashSet<>();
HashMap
• Key-value storage
• HashMap<Integer, String> map = new
HashMap<>(); [Link](1, "Java");
Iterators
• Traverse collections
• for(String s : list) { [Link](s); }
Collections Utility Class
• sort(), reverse(), shuffle()
Summary
• Collections simplify storage and operations on
groups of objects

You might also like