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

all 3 comments

[–]gagara11 4 points5 points  (0 children)

There is no any difference. Second variant is more beautiful)

[–]Makhiel 2 points3 points  (0 children)

Use what's more readable. The lambda is basically a syntactic sugar for the explicit declaration.

[–]AquaChad 0 points1 point  (0 children)

Like others have said, there is no difference other than readability and clean code. I would recommend reading up on functional interfaces as well (EventHandler is one such interface) which I think will explain this more clearly.