Java Threads | Create multiple threads with Runnable
Download code here
Threading.javapublic class Threading{
public static void main(String[]args){
Runnable r = ()->System.out.printf(
"Current: %s%n",
Thread.currentThread().getName()
);
for(int i = 1; 5 >= i; i ++) new Thread(r).start();
}
}
Comments
Post a Comment