What is the meaning of ()->System.out.println("done")?
concurrency, java, java-8, lambda
Solution
This is Lambda syntax from JDK8.
It is pretty similar (but not exactly same) to
exec.schedule(new Runnable() {
public void run() {
System.out.println("done");
}
}, 1, TimeUnit.SECONDS);
Problem
In Concurrency Interest link, there is a code which is like this:- ``` exec.schedule( ()-> System.out.println("done"), 1, TimeUnit.SECONDS ); ``` What is the meaning of ()-> ? I checked in eclipse, it does not allow. But what was the intention of the thread-writer?