Review Questions |
9.5 |
Given the following program, which statements are guaranteed to be true?
public class ThreadedPrint { static Thread makeThread(final String id, boolean daemon) { Thread t = new Thread(id) { public void run() { System.out.println(id); } }; t.setDaemon(daemon); t.start(); return t; } public static void main(String[] args) { Thread a = makeThread("A", false); Thread b = makeThread("B", true); System.out.print("End\n"); } } Select the two correct answers.
|
Get Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.