Skip to content
KnowledgeCity

Advanced Java: Collections

Get an overview of the Collection framework plus how to use the collections utility classes and customer sorting
Preview the first lesson free — get full access to all 3 lessons.
Course: On-Demand
Advanced Provider Scott Stanlick  3 Lessons ·  20m  in Arabic, German, English, Spanish, French, Portuguese, Chinese 

Course Description

In these lessons you will see the Collections framework in action. The framework has data structures to fit any programming problem—and in many cases, several to choose from—allowing you to choose the best performing collection type. The collections framework has evolved with each release of the Java language, and recent advances have only catapulted it further ahead. We will explore the Collections utility class to see the wonderful bounty of static helper functions available for use. Many functions and algorithms are fully developed, and all you need to know is where they are and how to use them. We’ll demonstrate how to solve difficult programming problems using these collection types.

We will explore writing custom sorting algorithms and leveraging them by using the Collection.sort() function. Then we’ll wrap up by looking at how to create an unmodifiable collection that can be safely shared across the code base without fear of anyone clearing or otherwise tampering with its contents, effectively making it a read-only collection.

What You'll Learn

  • Describe the Java Collections framework and its collection types
  • Navigate the collection type hierarchy to choose the best-performing collection for a problem
  • Use the static helper methods available on the Collections utility class
  • Apply Collection.sort() with both natural and custom sort orders
  • Overload sort behavior by writing custom sorting algorithms
  • Create an unmodifiable, read-only collection that can be safely shared across a code base

Key Takeaways

  • The Collections framework provides data structures to fit any programming problem, often offering several options so you can choose the best-performing collection type.
  • The Collections framework has evolved with each release of the Java language, and recent advances have moved it further ahead.
  • The Collections utility class offers many static helper functions and fully developed algorithms that you only need to locate and apply.
  • Sort behavior can be overloaded, allowing custom sorting algorithms to be leveraged through the Collection.sort() function.
  • An unmodifiable collection can be shared safely across a code base without fear of it being cleared or tampered with, effectively making it read-only.

Frequently Asked Questions

What does this course cover?

It covers the Java Collections framework in action, including the collection type hierarchy, the static helper methods on the Collections utility class, natural and custom sort order using Collection.sort(), and how to create unmodifiable (read-only) collections.

What lessons are included?

The course includes three lessons: Collection Type Hierarchy, Static Helper Methods, and Natural and Custom Sort Order.

What skills will I gain from this course?

You will work with the Java Collections Framework, ArrayList, Java Data Objects, and features across Java 7, Java 8, and Java 11.

Will I learn how to sort collections?

Yes. The course explores writing custom sorting algorithms and leveraging them with the Collection.sort() function, covering both natural and custom sort order.

How can I safely share a collection without it being modified?

The course demonstrates how to create an unmodifiable collection that can be safely shared across the code base without anyone clearing or tampering with its contents, effectively making it read-only.