0% found this document useful (0 votes)
11 views9 pages

Collections Framework

The document introduces the Collections Framework in Java, highlighting the need for collections and comparing arrays to collections. It explains that collections can hold different types of objects and grow dynamically, unlike fixed-size arrays. Additionally, it mentions legacy classes such as Stack, Vector, and Hashtable that are part of the Java library for handling collections.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views9 pages

Collections Framework

The document introduces the Collections Framework in Java, highlighting the need for collections and comparing arrays to collections. It explains that collections can hold different types of objects and grow dynamically, unlike fixed-size arrays. Additionally, it mentions legacy classes such as Stack, Vector, and Hashtable that are part of the Java library for handling collections.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

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

You might also like