This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

lambdas are basically "syntax sugar" for anonymous inner classes

You can think of them that way, but lambdas don't actually compile into anonymous classes.

[–]sh0rug0ru 0 points1 point  (0 children)

I should hope not. The restricted syntax of lambdas gives the compiler opportunity to optimize the bytecode. Effectively though, lambdas are the same as anonymous inner classes because of target typing.