Meaningless Drivel is fun!*
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


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 ;)
 
GeeCON Prague 2014
 
subject: Question 16, Practice Exam from K&B Book