Java Lambda Expressions
A lambda is a short way to write a small function you can pass around. Shape: (params) -> expression, or { statements }. It implements a functional interface — one abstract method. Example: names.forEach(n -> System.out.println(n));
Lambdas make collection and stream code shorter when they stay small. Method references (System.out::println) are even shorter sometimes. Don’t dump huge business logic inside a lambda.
Interview line — lambda = concise implementation of a functional interface.
Let's take this on the board with one tiny Main class — no extra files. Java Lambda Expressions — output: A then B then C. n -> println(n) is a real lambda — short function passed to forEach. Start from main, go line by line, and stop at each print. That output is the proof for Lambda Expressions.
Define lambda + show forEach one-liner.