Core java tutorial for beginners
A tutorial blog which explains different core concepts related to Java along with programming examples
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Categories: Java Collections. 2 Comments on Introduction to Java Collections Framework
5
(1)

This article provides a comprehensive overview of  Java Collections Framework (JCF) which is used by many developers to write java programs.

 

What is Java Collections Framework?

In order to write efficient programs you need to know how to work with a data structure. A data structure is a entity which contains a group of data organized in some manner. Examples of popular data structures are arrays, stacks, queues, linked lists, trees, etc.

 

Java provides many data structures. The data structure framework or library provided by Java is known as the Java Collections Framework (JCF). Java defines a collection as an object that represents a group of objects.

 

The collections framework is a standard way for representing and manipulating collections. It contains the following components:


Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests.


 

  • Interfaces: These are abstract data types that represent collections. Interfaces allow collections to be manipulated independently of the details of their representation. In object-oriented languages, interfaces generally form a hierarchy.

 

  • Classes: These are the concrete implementations of the collection interfaces. In essence, they are reusable data structures.

 

  • Algorithms: These are the methods that perform useful computations, such as searching and sorting, on objects that implement collection interfaces. The algorithms are said to be polymorphic: that is, the same method can be used on many different implementations of the appropriate collection interface. In essence, algorithms are reusable functionality.

 

What Can I Do with a Collection?

 

  • Add objects to the collection.
  • Remove objects from the collection.
  • Find out if an object (or group of objects) is in the collection.
  • Retrieve an object from the collection (without removing it).
  • Iterate through the collection, looking at each element (object) one after another.

 

Goals of Java Collections Framework

 

The collections framework was designed to meet the following goals:

 

  • The framework had to be high-performance. The implementations for the fundamental collections (dynamic arrays, linked lists, trees, and hash tables) are highly efficient.
  • The framework had to allow different types of collections to work in a similar manner and with a high degree of interoperability.
  • Extending and/or adapting a collection had to be easy.

 

Interfaces in Java Collections Framework

 

Following is the Java Collections Framework hierarchy:

 

java collections framework hierarchy

 

Following are various interfaces available in Java Collections Framework:

 

Java Collection Interfaces

 

Classes in Java Collections Framework

 

Following are various classes available in Java Collections Framework:

 

java collection classes

 

 

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Suryateja Pericherla

Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.

He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.

He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.

Note: Do you have a question on this article or have a suggestion to make this article better? You can ask or suggest us by filling in the below form. After commenting, your comment will be held for moderation and will be published in 24-48 hrs.

2 Comments

You can follow any responses to this entry through the RSS 2.0 feed.

Java Collection framework is a very popular framework of Java which provides a strong architecture to store or easily control the group of objects. For the purpose of better understanding.

    aahan

Leave a Reply

Your email address will not be published. Required fields are marked *