What is a collection in java

rajesh1761

Rajesh Mishra

Posted on June 21, 2020

What is a collection in java

What is a collection in java

A collection is an object that groups one or more than one element into a single unit. Collection framework provides interfaces and classes to store, retrieve and manipulate the data.

A collection framework contains interfaces, implementations and classes

  • interfaces -Interfaces allow collections to be manipulated independently of the details of their representation
  • implementations– These are reusable data structures.

Benefit of using collection:-

  • We can add any objects to the collection.
  • We can remove any objects from the collection.
  • We can identify an object or group of objects from the collection.
  • We can iterate/loop through the entire collection using utility classes.

Followings are the some list of Collection classes in Java:

For sorting of collection use following interfaces:


Lear more about Collections in Java

💖 💪 🙅 🚩
rajesh1761
Rajesh Mishra

Posted on June 21, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What is a collection in java
collectionsinjava What is a collection in java

June 21, 2020