public class Main {
public static void main(String[] args) {
new Thread(){
{ this.setDaemon(true); }
public void run() {
while(true) {
System.out.println("Thread is running!");
}
}
}.start();
}
}
Example №2:
public class Main {
public static void main(String[] args) {
new Thread() {
public void run() {
while(true) {
System.out.println("Thread is running!");
}
}
}.start();
}
}
Login in to like
Login in to comment