Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
Java
10.8K+ articles
Misc
8.8K+ articles
Java-Functions
4.2K+ articles
Java - util package
1.6K+ articles
java-basics
330+ articles
Java-ArrayList
154+ articles
java-list
95+ articles
Java-Stack
56+ articles
Java-LinkedBlockingDeque
49+ articles
Java-Collections
1.1K+ posts
Recent Articles
Popular Articles
How does LinkedHashMap maintain Insertion Order?
Last Updated: 05 February 2024
LinkedHashMap in Java maintains the order of elements based on which they were inserted. It achieves this by using a doubly-linked list internally to maintain the order of...
read more
Java
Java Programs
Picked
Java-Collections
Java-LinkedHashMap
Java Examples
Split a Vector into Multiple Smaller Vectors in Java
Last Updated: 09 February 2024
In the realm of Java programming, the manipulation of vectors is a common task. One particularly useful operation is splitting a vector into multiple smaller vectors. This...
read more
Java
Java Programs
Picked
Java-Collections
Java-Vector
Calculate the Sum and Average of Elements in an ArrayList in Java
Last Updated: 12 February 2024
A Dynamic and Adaptable method for storing and managing collections of elements is to use ArrayList. Finding the total and average of an ArrayList's items is frequently re...
read more
Java
Java Programs
Picked
Java-Collections
Java-ArrayList
How to Convert an ArrayList or an Array into a TreeSet in Java?
Last Updated: 05 February 2024
In Java, ArrayList allows random access because it works like an array. It means you can access any element by its index in O(1) at any time. A TreeSet is a sorted set imp...
read more
Java
Java Programs
Picked
Java-Collections
Java-ArrayList
java-treeset
Java Examples
How to Add or Append Elements to End of a TreeSet in Java?
Last Updated: 05 February 2024
A TreeSet is a sorted set implementation of the Set interface based on a TreeMap. It uses a Red-Black tree to store elements. Elements are sorted according to their natura...
read more
Java
Java Programs
Picked
Java-Collections
java-treeset
Java Examples
How to Retrieve a Specific Value From a HashMap Using Key?
Last Updated: 09 February 2024
A HashMap is a data structure that implements a map interface in Java. It stores key-value pairs. On the key object's hashcode, it uses a hashing function for computing an...
read more
Java
Java Programs
Picked
Java-Collections
Java-HashMap
Java Examples
How to Initialize a Vector with a Specific Initial Capacity in Java?
Last Updated: 12 February 2024
In Java, Vector Class allows to creation of dynamic arrays that can grow or shrink as per the need. If we know the approximate size of elements, we will store this in the ...
read more
Java
Java Programs
Picked
Java-Collections
Java-Vector
How to Copy Key-Value Pairs from One TreeMap to Another in Java?
Last Updated: 06 February 2024
In Java, a TreeMap is a Map implementation that stores key-value pairs in a red-black tree structure. It allows insertions and deletions of key-value pairs due to its tree...
read more
Java
Java Programs
Picked
Java-Collections
Java-Library
java-TreeMap
Java Examples
How to Customize the Ordering of Elements in a PriorityQueue Using a Comparator in Java?
Last Updated: 15 February 2024
A PriorityQueue is a data structure that allows elements to be processed based on their priority. By default, it orders elements according to their natural ordering (e.g.,...
read more
Java
Java Programs
Picked
Java-Collections
priority-queue
java-priority-queue
Java Examples
How to Handle Concurrent Access and Modification of a TreeMap Using Concurrent Collections in Java?
Last Updated: 14 February 2024
To solve data corruption in a multithreaded context, and thread safety, Java offers concurrent collections in the java.util.concurrent package. In this article, we will le...
read more
Java
Java Programs
Picked
Java-Collections
Java Examples
Java Collection Exercise
Last Updated: 12 March 2024
The Java Collection framework is a fundamental part of the Java programming language, It covers a major part of Java and acts as a prerequisite for many Advanced Java Topi...
read more
Java
Java Programs
Java-Collections
Java-ArrayList
Java-HashMap
java-priority-queue
java-hashset
java-set
java-queue
java-map
Java-Collection-Programs
How to Optimize Memory Usage and Performance for large HashSet Datasets in Java?
Last Updated: 05 April 2024
HashSet is mainly used for the data structures in Java offers fast access and prevents duplicate elements. So, the size of the dataset will be improved and it can raise me...
read more
Java
Java Programs
Picked
Java-Collections
java-hashset
Java Examples
How to Sort an Arrays of Object using Arrays.sort()
Last Updated: 13 June 2024
To sort the array of objects in both ascending and descending order in Java, we can use the Arrays.sort() method with the Comparator. In this article, we will learn how to...
read more
Java
Picked
Java-Collections
Stack Java Library
Last Updated: 03 November 2024
In Java, there are multiple ways to use built-in libraries for Stack.Stack Class It is a legacy collection from early Java versions. It is outdated and rarely used in mod...
read more
Java
Stack
Data Structures
Java-Collections
Java Collections Coding Practice Problems
Last Updated: 05 March 2025
Java Collections provides dynamic and efficient data structures for handling and processing data. This collection of Java practice problems covers fundamental concepts of ...
read more
Java
Java-Collections
Practice Questions
1
2
3
4
...
76
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !