This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Question 16, Practice Exam from K&B Book Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Question 16, Practice Exam from K&B Book" Watch "Question 16, Practice Exam from K&B Book" New topic
Author

Question 16, Practice Exam from K&B Book

Konrad Till
Greenhorn

Joined: Nov 20, 2012
Posts: 7
Can anybody explain me, why does this code print also "0"?
(the code is slightly modified by me - added the println statement)
It looks like 0 > 0 returns true. I'm quite confused about that.

dennis deems
Ranch Hand

Joined: Mar 12, 2011
Posts: 808
Try printing the current thread Id just before x is printed, and see if that helps to clear things up.
Konrad Till
Greenhorn

Joined: Nov 20, 2012
Posts: 7
Thanks! I totally forgot about that statement ;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question 16, Practice Exam from K&B Book
 
Similar Threads
Why does this count down to zero and not to 1
Thread Deadlocking doubt
Why won't the following Deadlock? Exam 2 q.16
Please suggest ways to cause deadlock in this code
Threading Problem