Pregunta de entrevista de Tech Mahindra

What are the main features introduced in Java 8? What is a lambda expression? Give an example. What is Stream API and why is it used? Difference between map() and filter() in streams. What is a functional interface? Difference between forEach() and for loop. What is Optional in Java 8?