DEV Community

Dinesh G
Dinesh G

Posted on

Collections in Java

Collections in Java

Collection is a group of objects treated as a single unit.

Java Collections can achieve all the operations that you perform on a data such as searching, sorting, insertion, manipulation, and deletion.

Java Collection means a single unit of objects.

Java Collection framework provides many interfaces (Set, List, Queue, Deque) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet).

(JCF) is a unified architecture of interface and class that help store ,organize and manipulicate groups of objects efficiently .

What is a framework

A framework provides a ready-made structure of classes and interfaces for building software applications efficiently.

It simplifies adding new features by offering reusable components that perform similar tasks, eliminating the need to create a framework from scratch for each new project.

This approach enhances object-oriented design, making development quicker, more consistent, and reliable.

  • It provides readymade architecture.
  • It represents a set of classes and interfaces.
  • It is optional.

Collection Framework

  • Interface
  • Implemention entations
  • Algorithms
  • (c++ Standard Templates library (STL))

Common Interface

List => Ordered ,Allow Duplicates, Maintain Insertion order.

Set => No Duplicate ,No insertion Order

Map => Stores Key value pairs (not part of collection interface but in framework).

Why

  • Readymade data Structure
  • Dynamic Size
  • Standardized API
  • Built in Algorithms
  • Flexible and Efficient

Top comments (0)