This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum 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
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Question 16, Practice Exam from K&B Book
 
Similar Threads
Thread Deadlocking doubt
Threading Problem
Why won't the following Deadlock? Exam 2 q.16
Please suggest ways to cause deadlock in this code
Why does this count down to zero and not to 1