Tease your mind and test your learning, with these quick introductions to challenging concepts in Java programming.
Record declarations are an efficient way to encapsulate data in your Java classes while reducing boilerplate code. Learn how they work in both basic and advanced programming scenarios.
Learn how to use pattern-matching features in your Java programs, including pattern matching with switch statements, when clauses, sealed classes, and a preview of primitive type pattern matching in Java 23.
Since Java 21, wrapper classes have played an increasingly sophisticated role in Java’s type system. Here’s everything you need to know about updates for virtual threads, pattern matching, and more.
Get a deep dive into using method references in your Java programs, including stream operations, event listeners, and constructors and factories.
Type erasure in Java generics programming can cause a variety of problems in your code. Fortunately, there are ways to work around them.
Take your coding to the next level by learning advanced programming with generics. Here's how to use generic methods with type inference, type parameters, and wildcards in your Java programs.
Generics make your code more flexible and easier to read, and they help you avoid ClassCastExceptions at runtime. Get started with this introduction to using generics with the Java Collections Framework.
Learn how and why Java developers use method overloading, then test your learning against the Java virtual machine itself.
Have you ever wondered how Java's String methods, keywords, and operators process comparisons in a String pool? Here's your chance to find out!
The JVM does what it wants to do, so how can you predict the order of thread execution?
Get started with polymorphism in Java and how to do method invocation in polymorphic method calls.
You might know that Java passes by value, but it helps to understand why. Here's what happens when you pass mutable and immutable object references in Java.
Compare inheritance and composition, the two fundamental ways to relate Java classes, then practice debugging ClassCastExceptions in Java inheritance.
Do you need to know how to sort Java objects in a collection, array, or map? Here's how to use the Comparable and Comparator interfaces and avoid ClassCastExceptions.
What is the contract between equals() and hashcode()? Learn how these methods work together when comparing objects in Java.
Java's Calendar class had its day, but the newer LocalDate class does much more. Here are seven ways to use LocalDate in your Java programs.
Copying objects is a common Java programming operation that has one serious trap. Here's how to avoid copying from an object reference and only copy the instance and values you want.
Abstract classes and interfaces in Java serve fundamentally different purposes. Learn the differences between these Java language elements and how to use them in your programs.
Maximizing code reuse in your Java programs means writing code that is easy to read, understand, and maintain. Here are eight ways to get started.
Learn how to optimize JVM and JIT compiler performance for better execution speed, memory usage, and resource utilization in your Java applications—and how to check your results.