0% found this document useful (0 votes)
10 views

The Java Collection Framework: A Unified Architecture For Representing and Manipulating Collections

The Java Collection Framework provides a unified architecture for representing and manipulating collections. It includes interfaces like Collection, Set, and List as well as implementations like ArrayList, LinkedList, and TreeSet. The framework reduces programming effort, increases program speed and quality, and allows interoperability among unrelated APIs.

Uploaded by

Abdul Gafur
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

The Java Collection Framework: A Unified Architecture For Representing and Manipulating Collections

The Java Collection Framework provides a unified architecture for representing and manipulating collections. It includes interfaces like Collection, Set, and List as well as implementations like ArrayList, LinkedList, and TreeSet. The framework reduces programming effort, increases program speed and quality, and allows interoperability among unrelated APIs.

Uploaded by

Abdul Gafur
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

The Java Collection Framework

A unified architecture for representing and manipulating collections


Interfaces Implementations Algorithms It reduces programming effort It increases program speed and quality It allows interoperability among unrelated APIs It fosters software reuse

Advantages

Interfaces
z z

Collection

general interface cannot contain duplicate elements ordered collection maintains its elements in ascending order

Set

z z

List

SortedSet

Object Ordering
z

Implement Comparable interface


provides a natural ordering allows objects of that class to be sorted automatically could be sorted in the natural orderering by method Collections.sort(List l) all objects sorted according to the natural ordering

List

SortedSet

Implementation
z z

SortedSet

TreeSet ArrayList LinkedList Vector etc.

List

Comparable interface
z

Source code
public interface Comparable { public int compareTo(Object ob); }

Method compareTo returns


negative ob is less than this object zero ob is equal to this object possitive ob is greater than this object

Collection interface

For more information


z

Documentation of the Collection Framework


http://java.sun.com/j2se/1.4.2/docs/guide/collections/index.html

Tutorial API Specification

Introduction to the Collection Framework


http://java.sun.com/developer/ onlineTraining/collections/Collection.html

You might also like