By Rahul Barve
Objectives
Introduction to Collections Framework.
Understand the Need for Collections.
Arrays Vs. Collections
Simple Example
Performing Iterations
Type Safe Collections
Types of Collections
Working with Sorted Collections
By Rahul Barve
Introduction to Collections Framework
By Rahul Barve
Introduction to Collections Framework
A collection is a data structure that contains different
types of objects.
The framework provides interfaces that have some
contract or behavior which is applicable to the
relevant collection.
By Rahul Barve
Array Vs. Collection
By Rahul Barve
Array Vs. Collection
Contains elements of Can contain elements
similar types. of different types.
Has a fixed dimension. Grows dynamically as
Cannot be resized. elements are added.
Can work upon Works only upon
primitives as well as object types.
object types.
By Rahul Barve
Legacy Classes
By Rahul Barve
Legacy Classes
Java library provides several predefined classes right
from the first version to handle collection specific
functionalities.
Collection specific APIs belong to a package
java.util.
By Rahul Barve
Legacy Classes
Stack
Vector
Dictionary
Hashtable
Properties
By Rahul Barve