Tease your mind and test your learning, with these quick introductions to challenging concepts in Java programming.
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.
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.
Here's a quick look at the three types of class loaders and everything you need to know to work with them in your Java programs.
Use ForkJoinPool to break down computationally intensive tasks and execute them in parallel for better Java application performance.
Learn how to use synchronous and asynchronous callbacks in Java—including callbacks with lambda expressions, CompletableFuture, and more.
The Observable design pattern is found in many Java APIs and in reactive programming. Here's an introduction to the timeless Observable pattern in Java.
Learn how to use lazy instantiation and eager instantiation in your Java programs. Which approach is better? It depends on the scenario.
Learn how to use the Command pattern to encapsulate requests as objects that you can execute alone or in sequence in your Java programs.