public class ThreadDemo {
public static void main(String[] args) {
new Thread(test()).start();
new Thread(test1()).start();
}
public static Runnable test(){
System.out.println(Thread.currentThread().getName());
return null;
}
public static Runnable test1(){
return () -> System.out.println(Thread.currentThread().getName());
}
}
public class ThreadDemo {
public static void main(String[] args) {
new Thread(test()).start();
new Thread(test1()).start();
}
public static Runnable test(){
System.out.println(Thread.currentThread().getName());
return null;
}
public static Runnable test1(){
return () -> System.out.println(Thread.currentThread().getName());
}
}