Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
Jiang Bian
Greenhorn
+ Follow
news
2
Posts
1
Threads
since Dec 03, 2008
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads
Recent posts by Jiang Bian
Thread question 9 in K&B P765
Well, the only thing I can hope is that the real questions won't be ambiguous.
Thanks!
show more
15 years ago
Programmer Certification (OCPJP)
Thread question 9 in K&B P765
public class ThreadTest { public static synchronized void main(String[] args) throws InterruptedException { Thread t = new Thread(); t.start(); System.out.println("X"); t.wait(10000); System.out.println("Y"); } }
The answer is "An exception is thrown at runtime", which I totally understand. But my question is why "A. It prints X and exits." not correctly.
Although it exits with an exception, but it will print X and exits.
Thanks in advance!
Jiang
show more
15 years ago
Programmer Certification (OCPJP)