CodeGym University
Java FullStack
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme
Group
Reviews
About us
Start
Start learning
Start learning now
Articles
Authors
All groups
All Articles List
CodeGym
/
Java Blog
/
Java Collections
Java Collections
290 members
Leaderboard
Popular
New
Old
Vasyl Malik
Java Collections
August 31, 2022 at 10:46 AM
Java Collections sort()
One of the most common functions we need as developers dealing with data is sorting--by being able to sort our data, we can optimize our algorithms to run much faster, and find the data it needs to in a fraction of the time that it would take to otherwise. As a quick thought experiment: imagine that you are...
Oleksandr Miadelets
Java Collections
January 12, 2025 at 2:06 PM
Java Queue Interface and implementations
Here we are going to discuss the Java Queue interface. You’ll find out what Queue data structure is, how it is represented in Java, what methods are the most important for all queues. Also, what implementations of Queue are in Java language. After that, we take a closer look at the most important...
Oleksandr Miadelets
Java Collections
January 11, 2025 at 8:54 AM
Java Iterator
Imagine that you go to the library, and you want to find a particular book. How do you do it? If it’s non-fiction, there’s the Dewey Decimal System. If it’s fiction, they’re sorted in alphabetical order by their last name. Whatever you’re looking for, at some point, you have to go through the books one at a time until you...
Alex Vypirailenko
Java Collections
October 20, 2021 at 1:50 PM
How to Replace an Element in Java ArrayList
Simple arrays in Java do not offer any method to update or replace an element. Nevertheless in ArrayList replace is pretty convenient to implement using the set method...
Milan Vucic
Java Collections
February 15, 2025 at 2:03 PM
Java Deque Interface
Java Deque is a data structure that combines an ordinary Queue and Stack. You may add and remove elements both to the head and to the tail of the Deque. In the “traditional” queue you add elements to the tail of the line (after the last element) and remove elements from the head of the queue...
Vasyl Malik
Java Collections
August 18, 2022 at 8:04 AM
Collections in Java
A collection in java is represented as a container that groups all the elements into a single unit. For example, a mail folder (group of emails), a telephone directory (mapping of names to phone numbers)...
John Selawsky
Java Collections
March 23, 2022 at 12:01 PM
How to update the value of an existing key in HashMap
You know that there is always a key and a value in HashMap or any other Map. Key is called a key for a reason, because you get the access to values by the key. The key is unique...
Jesse Haniel
Java Collections
January 13, 2025 at 11:36 AM
Java Priority Queue: not a classical queue
In this article we learn a priority queue, Java class, that implements Queue interface. What does a programmer know of regular Queue Interface? First of all, this interface is based on the FIFO principle or “first in first out”. That reminds a regular queue in its common meaning. You want to get coffee from McDrive?
John Selawsky
Java Collections
December 21, 2024 at 8:49 AM
HashMap getOrDefault method in Java
What is the getOrDefault method for HashMaps in Java? “The getOrDefault method returns the value mapped to the specified key in a HashMap. If that key is not present then a default value is returned.”...
Pavlo Plynko
Java Collections
January 14, 2025 at 12:24 PM
Java Hashtable
Java Hashtable class is one of the oldest members of Java Collection Framework. It is an implementation of mathematical hash table data structure. In Java hashtable internally contains buckets where the key/value pairs are stored. Hashtable is pretty similar to HashMap. The most significant difference between...
Pavlo Plynko
Java Collections
September 8, 2023 at 6:59 AM
Convert List to Array in Java
List and arrays are two ways to store data in Java that you will use quite often. In projects where you need to store data without any sort of file handling, list and arrays let you store data throughout the execution of your program. We’ll be using Class ArrayList...
Volodymyr Portianko
Java Collections
February 10, 2025 at 2:20 PM
How to Print an Array in Java
Java provides Array data structure to store different elements of the same data type. The elements are stored in contiguous memory. To display the similar contents of the array, the elements are needed to be printed...
Show more
1
2
3
4
Please enable JavaScript to continue using this application.