BAEL-1263 Daemon Threads in Java

This commit is contained in:
Ahmed Tawila 2017-10-29 12:59:55 +02:00
parent 31e2f177ad
commit 1be0d76f8c
2 changed files with 3 additions and 7 deletions

View File

@ -3,7 +3,8 @@ package com.baeldung.concurrent.daemon;
public class NewThread extends Thread {
public void run() {
for (int i = 0; i < 10; i++)
System.out.println("New Thread is running...");
while (true)
for (int i = 0; i < 10; i++)
System.out.println("New Thread is running...");
}
}

View File

@ -25,9 +25,4 @@ public class DaemonThreadTest {
daemonThread.start();
daemonThread.setDaemon(true);
}
@Test
public void givenUserThread_whenStartThread_thenFalse() {
NewThread daemonThread = new NewThread();
}
}