Modern Java

Generics, lambdas and streams, and designing a complete program.

About 4 hours of study

Learning objectives

Lessons

  1. 1

    Generics Advanced

    Writing classes and methods that work with any type while keeping type safety: type parameters, the diamond operator, generic methods, bounded types such as T extends Comparable, and wildcards.

  2. 2

    Lambdas and streams Advanced

    Passing behaviour as values with lambdas and method references, functional interfaces, comparators, and processing collections declaratively with streams: filter, map, sorted, collect, groupingBy and Optional.

  3. 3

    Putting it together: designing a complete program Advanced

    Building a small application from the whole course: splitting it into classes with clear responsibilities, choosing collections, validating with exceptions, separating input from logic, and testing by hand.

Module practice

Module quiz

1. What does List<String> guarantee?
2. What is x -> x * 2?
3. Which stream operation keeps only some items?
4. Why write <T extends Comparable<T>>?
5. What does findFirst return?
6. Why check every rule before changing an object's state?

‹ Errors and collectionsFinal assessment ›