Thursday, September 11, 2014

Lambda : Creating instance for Runnable interface.

public class LambdaRunnable {
       public static void main(String[] args) {
              Runnable r = () -> {for(int i=0; i<10 span="">i++){System.out.println("Lenin");}};
              Thread t = new Thread(r);
              t.start();
       }

}

No comments:

Post a Comment