A tutorial covering Java functional interfaces and lambda expressions, using the Comparator interface as a practical example. Explains why Java's object-oriented nature makes passing behavior verbose, introduces the Comparator interface as an alternative to Comparable for flexible sorting, demonstrates anonymous classes as an intermediate step, and then shows how lambda expressions simplify the syntax. Covers lambda syntax variants including single-parameter, multi-parameter, no-parameter, and multiline forms, and explains how Java uses target typing to infer types from context.

49m watch time

Sort: