Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Lambda Expressions

om42701619Sep 19 2013

Hi Folks,

This is my first day in Lambda world.

And I cannot understand why this code works:

new JButton().addActionListener(e -> {System.err.println("Hello from lambda");});

And this doesn't:

new Thread(r -> {System.err.println("Hello from lambda");}).start();

What is the difference???

Thanks!

Omar

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2013
Added on Sep 19 2013
0 comments
243 views