DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Floyd's Cycle Algorithm for Fraud Detection in Java Systems
  • Merge Multiple PDFs in MuleSoft
  • Scaling Java Microservices to Extreme Performance Using NCache
  • What Is a Jagged Array in Java With Examples?

Trending

  • Solid Testing Strategies for Salesforce Releases
  • Internal Developer Portals: Modern DevOps's Missing Piece
  • Beyond Linguistics: Real-Time Domain Event Mapping with WebSocket and Spring Boot
  • Streamlining Event Data in Event-Driven Ansible
  1. DZone
  2. Data Engineering
  3. Data
  4. The Best of Java Collections [Tutorials]

The Best of Java Collections [Tutorials]

The Java Collections Framework (JCF) has become ubiquitous among Java developers.

By 
Lindsay Burk user avatar
Lindsay Burk
·
Dec. 05, 19 · Presentation
Likes (56)
Comment
Save
Tweet
Share
85.4K Views

Join the DZone community and get the full member experience.

Join For Free

car collection

Who doesn't love a good collection?

When it comes to building Java applications, the Java Collections Framework (JCF) has become ubiquitous among developers. Since the release of JDK 2, Java objects and data structures have changed development for the better, boosting performance and reducing programming efforts.

Oracle defines collections and the JCF as:

"An object that represents a group of objects (such as the classic Vector class). A collections framework is a unified architecture for representing and manipulating collections, enabling collections to be manipulated independently of implementation details."

Below, you can find a number of articles dedicated to breaking down the JCF architecture, as well as tutorials on performance, Collection interfaces, and Maps. Enjoy!

Overview of Collections

Justin Albano's series The Developer's Guide to Collections: Lists and Sets— It's time for a deep dive into collections in Java, including the defining philosophy of collections, important methods, and advice for implementation.

Check out these stellar posts from Jay Sridar: A Look at Java Collections and Java Collections: The List and Collections Interfaces. These two posts will cover everything you need to know when getting started with the Collections framework.

An Introduction to the Java Collections Framework by Marcus Biel— A high-level introduction to the Java Collections Framework, including the class hierarchy.

Java Collections Are Evolving by Trisha Gee — Collections have seen a lot of changes in the past couple of JDKs. This post looks at how they've improved in Java 9 and Java 10.

Processing Collections

Collections and Encapsulation in Java by Dave Taubler— A core tenant of object-oriented programming is encapsulation.

Immutable Collections in Java 9 by Harinath Kuntamukkala — Java 9's Collection factory methods finally bring immutable collections. See how they work and how they can save you time and code.

How to Sort Objects in Java by Biplab Pal — Any Java developer worth their salt has used the Collection framework. Here is a simple tutorial that explains how to sort in Java.

Deep Clone Collection Objects in Java [Snippets] by Yogen Rai — Check out this post on how to deep clone an object in Java 8 using the Object.clone method and new Java streams.

Performance

Java Collection Performance by Leo Lewis — While this post is from all the way back in 2011, its contents are still relevant in the Java space. Go check it out!

Iteration Over Java Collections With High Performance by Dang Ngoc Vu — Learn more about the forEach loop in Java and how it compares to C style and Stream API in this article on dealing with collections in Java.

Performance Evaluation of Java ArrayLists by Viraj Salaka, Malith Jayasinghe, Isuru Perera, and Srinath Perera — Here's a performance breakdown of the ArrayList add operation to see how to get the most throughout out of your ArrayLists.

How to Prevent Your Java Collections From Wasting Memory by  — Wondering about the memory impact of your Java collections? Here's how to think about your collections while keeping overhead in mind.

Performance Analysis of ArrayList and LinkedList in Java by Anant Mishra — ArrayList and LinkedList are frequently used classes in the Java collection framework. If you know only understand basic performance comparisons of ArrayList and LinkedList, but not the minor details of these two classes, then this article is for you.

Improving Java Performance by Nataliya Muriy—This article touches on an abundance of performance issues, as well as how to optimize Java collections performance.

Benchmarking Java Lists Performance by Jay Sridar — This post examines the performance characteristics of the list implementations: ArrayList and LinkedList. 

[DZone Refcard] Java Performance Optimization by Pierre-Hugues Charbonneau — Getting Java apps to run is one thing. But getting them to run fast is another. This Refcard covers JVM internals, class loading (updated to reflect the new Metaspace in Java 8), collections, troubleshooting, monitoring, concurrency, and more.

Lists

Convenience Factory Methods for Collections in Java 9 by Bartłomiej Słota — Java 9 brings with it some new convenience methods for dealing with collections. Here, we look at the role they play in Lists, Sets, and Maps.

How to Easily Create Lists, Sets, and Maps in Java [Video] by Marco Behler — Check out this post to learn how easy it is to create lists, sets, and maps from Java 9 onwards.

How to Convert Between List and Array in Java by John Thompson — Want to learn more about converting a list to an array in Java? Check out this tutorial to learn more using the Apache Commons Lang and Guava.

How to Create an ArrayList in Java by Mahesh Sharma — Learn more about how this widely-used function adds functionality and flexibility to your applications.

How to Convert Array to ArrayList in Java by Ryan Wang — This one is an oldie-but-a-goodie. Every Java programmer knows ArrayList — while the concept itself is relatively simple, it can be easy to make mistakes. Here's how to convert an Array to an ArrayList with no mistakes.

Different Approaches to Sorting Elements of an ArrayList in Java by John Thompson — Learn different approaches for sorting elements of an ArrayList — one using Comparable and the other using Comparator.

How to Convert an Array to a String in Java [Code Snippet] by Ramesh Fadatare — Learn the different ways to convert arrays and/or integers to a string.

Sets and Queues

The Developer's Guide to Collections: Sets by Justin Abano — Time for another deep dive into Java collections! This time, we focus on the concept of sets, the set interface, and everything you can do with sets.

The Developer's Guide to Collections: Queue by Justin Albano — Let's continue our journey into Java collections by examining the concept and proper usage of queues and deques in your code.

What Is a Queue? by Anders Olsen — Want to learn more about using a queue in Java? Check out this post to learn more about using a queue linear data structure in your next project.

HashSet Vs. TreeSet Vs. LinkedHashSet by Ryan Wang — In a set, there are no duplicate elements. That is one of the major reasons to use a set. There are three commonly used implementations of Set in Java: HashSet, TreeSet, and LinkedHashSet. 

Get Your Internal Queues Under Control in Java by Petr Bouda — There are a lot of reasons why you should be using internal queues in your program.

Java Concurrency: BlockingQueue by Jakob Jenkov— Learn more about queues in this simple implementation of a Java BlockingQueue.

Maps

Java 8 Map, Filter, and Collect Examples by Javin Paul — Read this post to learn how to use the Map and Filter functions in Java 8 to transform and filter elements of objects.

HashMap Vs. TreeMap Vs. HashTable Vs. LinkedHashMap by Ryan Wang — We look at the most commonly used implementation of Map in Java and how to differentiate between use cases.

How to Convert List to Map in Java by Hussein Terek — Want to learn how to convert List to Map in Java? Read this post to learn how to do this in both Java 7 and Java 8.

How to Sort a Map by Value in Java 8+ by Yogen Rai — Want to learn more about sorting a map value in Java 8 or above? Click here for more about sorting maps in this tutorial.

Removing Elements From a Map in Java by Dan Newton — This is a very short and simple post on removing elements from a Map in Java, focusing on removing multiple elements and ignoring the fact that you can remove a single element using Map.remove.

How to Use Java HashMap Effectively by A. N. M. Bazlur Rahman — Struggling with HashMaps? Here's how to effectively use Java HashMaps.

Java HashMap Implementation in a Nutshell by Yogen Rai — Want to learn more about custom HashMap implementation in Java? Check out this tutorial on how we can implement this data structure using arrays.


Further Reading

  • The Complete Apache Spark Collection [Tutorials and Articles].
Java (programming language) Data structure

Opinions expressed by DZone contributors are their own.

Related

  • Floyd's Cycle Algorithm for Fraud Detection in Java Systems
  • Merge Multiple PDFs in MuleSoft
  • Scaling Java Microservices to Extreme Performance Using NCache
  • What Is a Jagged Array in Java With Examples?

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!