Java 8 Method Reference example

package com.vinod.test;

public class Java8ThreadExample {
public static void main(String[] args) {
Thread t1 = new Thread(Java8ThreadExample::printJob);
Thread t2 = new Thread(Java8ThreadExample::printJob);
t1.start();
t2.start();

}
public static void printJob() {
for (int i = 1; i <= 15; i++) {
System.out.println(Thread.currentThread()+"printing" + i);
}

}
}

No comments:

Post a Comment

Confusion Matrix + Precision/Recall (Super Simple, With Examples)

  Confusion Matrix + Precision/Recall (Super Simple, With Examples) 1) Binary Classification Setup Binary classification means the model p...

Featured Posts