Lambdas in Java 8 provides a great way to define the problem as a statement and keeps the code concise. But do they change the way in which statements are executed in the JVM?
Lets consider i am writing a lambda which streams a list of objects and filters them based on a condition and returns the filtered values as a list of the same data type. My lambda would basically have a filter and a collector. When this piece of code is sent to the VM, does the compiler replace the lambda functions with traditional if loops and for loops?
I am asking this because the Virtual Machine is still the same and it was originally designed for imperative style of programming. What really changed in Java 8 was the way(FP) in which we define a problem statement. Is my understanding correct?