Skip to content
  • Facebook
GeekCer Logo

GeekCer

The geek's Coding education and Review centre

  • Home
  • Tutorials
    • Java
    • Servlet
    • JSP
    • Python
    • C Tutorial
    • Spring
    • Spring Boot
    • MongoDB
    • Hibernate
    • Data Structure
  • General Knowledge
  • Biography
  • Grammar
  • Festival (त्योहार)
  • Interview
  • Differences
  • Important
  • Toggle search form

Home » Java » Collections in Java

  • Newton's laws of Motion, State and Explained, Formula
    Newton’s laws of Motion, State and Explained, Formula Science
  • Farmers Day
    National Farmers Day in Hindi | राष्ट्रीय किसान दिवस पर निबंध | चौधरी चरण सिंह जयंती General Knowledge
  • Fundamental Duties of Indian Citizens
    Fundamental Duties of Indian Citizens | 11 मौलिक कर्तव्य हिंदी में General Knowledge
  • Chhath Puja Story
    Chhath Puja History : क्यों मनाते हैं छठ महापर्व Festival
  • Real life Inspirational Stories in Hindi | Success story in Hindi
    Real life Inspirational Stories in Hindi | Success story in Hindi Biography
  • Lanka Kand Summary in Hindi | Ram Vs Ravana | लंका काण्ड
    Lanka Kand Summary in Hindi | Ram Vs Ravana | लंका काण्ड Spiritual
  • Human rights day
    Human rights day in Hindi: 10 दिसंबर ह्यूमन राइट्स डे General Knowledge
  • जन्माष्टमी व्रत पूजा विस्तार से | दही हांडी | Krishna Janmashtami Puja
    जन्माष्टमी व्रत पूजा विस्तार से, दही हांडी: Krishna Janmashtami Puja Festival

Collections in Java

Posted on August 16, 2021October 20, 2021 By GeekCer Education No Comments on Collections in Java
Collections in Java

A Collections in Java is an object that can store a group of other objects. There is an another term of collection object is container object. Java Collections may store same type as well as different type of data.

Collection object does not store the physical copies of other objects because the objects are already available in memory. It simply stores the references of other objects into collection object.

Collections in Java contains different methods to perform different operations, for example, it stores, retrieves and manipulates data by using those methods.

Table of Contents

  • Collection Framework
    • Basic Interfaces of Collection Framework
  • Advantages of Collections over Arrays in Java
      • Conclusion

Collection Framework

A collection framework is actually a class library which handles groups of objects and it defines several classes and interfaces, which represents group of objects as a single unit.

Basic Interfaces of Collection Framework

All the collection classes and interfaces are available in java.util package. Here is the following key interface of collection interface

#InterfacesDescription
1CollectionCollection Interface is a root interface of collection framework.
2ListList preserves insertion order and can contain the duplicates.
3SetSet does not preserve insertion order and also does not contains the duplicates.
4SortedSet SortedSet does not preserve insertion order and does not contain duplicates, but stores the elements in some sorting order.
5QueueHolds elements prior to processing.
6MapMap stores a group of objects but in the form of key-value pairs.
7SortedMapStores a group of objects as key-value pairs, but according to some sorting order.

Advantages of Collections over Arrays in Java

There are following key advantages of collections over arrays which are as follow:

  • Size of collection can be increase or decrease because collections are growable in nature.
  • Collections can hold multiple types of objects homogeneous as well as heterogeneous.
  • In every collection there are some ready-made method support is available, because of those methods we can manipulates the data.

Memory point of view Collections is better than Array concept.

Performance point of view Array concept is better than Collections.

Conclusion

In conclusion, the programmer should decide which collection is helpful for handling the data plan he is creating in his software.

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • More
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Also Read

Java

Post navigation

Previous Post: Object Oriented Programming
Next Post: Java ArrayList

More Related Articles

Method Overloading in Java Method Overloading in Java Java
Stack Vs Heap in Java Stack Vs Heap in Java | Memory Allocation Section in Java Differences
Java ArrayList Java ArrayList Java
Top Java Programs for Coder Top Java Programs for Coder Java
Java 8 Stream map example | Java 8 map(function) parameter Java 8 Stream map example | Java 8 map(function) parameter Java
Lambda Expression in Java 8 | Functional Interface | Example Lambda Expression in Java 8 | Functional Interface | Example Java

Leave a Reply Cancel reply

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

  • Java Home
  • Java Comments
  • Java Variables
  • Java Data Types
  • Java Keywords
  • Java Operators
  • Java If-else Statement
  • Java Switch
  • Java Loop
  • Java Arrays
  • Method Overloading in Java
  • Java OOP
  • Java Collections
  • Java ArrayList
  • Java LinkedList
  • Java Vector
  • Multithreading in java
  • Thread Synchronization
  • Exception Handling
  • Java JDBC Driver
  • Java Database Connectivity steps
  • Lambda Expressions
  • Concurrent Collections
  • National Farmers Day in Hindi | राष्ट्रीय किसान दिवस पर निबंध | चौधरी चरण सिंह जयंती
  • Human rights day in Hindi: 10 दिसंबर ह्यूमन राइट्स डे
  • Unicef day is celebrated on December 11 | Speech on unicef day
  • Indian Navy Day: जल सेना दिवस कब और क्यों मनाया जाता है?
  • P V Sindhu Biography in Hindi, Badminton, State, Caste पी. वी. सिंधु जीवन परिचय, कहानी, राज्य, जाति
  • Draupadi Murmu Biography In Hindi | द्रौपदी मुर्मू की जीवनी
  • Network kya hai (नेटवर्क क्या है)
    Network kya hai (नेटवर्क क्या है) Networking
  • Difference between Internet and Intranet
    Difference between Internet and Intranet Differences
  • Similarities and difference between OSI and TCP/IP model
    OSI vs TCP/IP Model, Similarities and difference between OSI and TCP/IP model Networking
  • Difference between TCP and UDP
    Difference between TCP and UDP | TCP vs UDP examples Differences
  • IPv4 Vs IPv6 | Difference between IPv4 and IPv6
    IPv4 Vs IPv6 | Difference between IPv4 and IPv6 Differences
  • TCP/IP Model, Full Form, Layers and their Functions
    TCP/IP Model, Full Form, Layers and their Functions Networking
  • OSI Model | 7 Layers of OSI Model in Computer network
    OSI Model | 7 Layers of OSI Model in Computer network, Functions Networking
  • Java Tutorial
  • Servlet Tutorial
  • JSP Tutorial
  • Maven Tutorial
  • HTML Tutorial
  • Programs
  • Hindi/English Grammar
  • Difference Between ... and ...
  • HR Interview
  • Important Articles

Write to Us:
geekcer.code@gmail.com

  • About Us
  • Privacy and Policy
  • Disclaimer
  • Contact Us
  • Sitemap

Copyright © GeekCer 2022 All Rights reserved