Milan Milan - 19 days ago 6
Java Question

Lambda Expression Java Conversion

Im quite new to the new Java features and was wondering how I could convert this bit of code into a lambda expression?

tc.setCellValueFactory((p) -> {
return new ReadOnlyStringWrapper(p.getValue());
});


This is what IntelliJ Idea IDE is giving me.

Thsi is

Answer

What your IDE means is likely:

(p) -> new ReadOnlyStringWrapper(p.getValue());

No return needed.

Comments