class ADaemon implements Runnable {
public void run() {
try {
System.out.println("Running ADaemon");
Thread.sleep(1);
} catch (InterruptedException e) {
System.out.println("Exiting with InterruptedException");
} finally {
System.out.println("Should this run in any case?");
}
}
}
public class DaemonsDontRunFinally {
public static void main(String[] args) {
Thread t = new Thread(new ADaemon());
t.setDaemon(true);
t.start();
}
}
Login in to like
Login in to comment