This question evaluates knowledge of Java 8 language features and standard library APIs—lambda expressions, the Stream API, Optional, default methods on interfaces, and the java.time date/time API—focusing on the candidate's grasp of functional-style constructs and API semantics.
What are the key new features introduced in Java 8? Explain when and how you would use lambda expressions, the Stream API, Optional, default methods on interfaces, and the java.time date/time API, with short examples.