GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Question regarding S.O.P from JQ+ 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 regarding S.O.P from JQ+" Watch "Question regarding S.O.P from JQ+" New topic
Author

Question regarding S.O.P from JQ+

Rahul Ramachandran
Ranch Hand

Joined: Feb 27, 2001
Posts: 48
The question reads:
Consider the following lines of code...
System.out.println(null + true); //1
System.out.println(true + null); //2
System.out.println(null + null); //3
Which of the following statements are correct?
The given answer is:
None of the 3 lines will compile.
However when I ran it on JDK1.3 on my machine, it runs and prints
nulltrue
truenull
nullnull
Can anyone please explain?
Thank You
Rahul
Jaikumar Nair
Ranch Hand

Joined: Apr 04, 2001
Posts: 48
Hi Rahul,
I think questions on JQ+ are strictly for jdk 1.2. I think i had read about this statement in this forum itself. In jdk 1.3, it would print the results that you have mentioned.
People, correct me if i am wrong.
JAI
ratul banji
Ranch Hand

Joined: Mar 15, 2001
Posts: 108
I ran it in JDK 1.2.1
It is not working.
Thanks.
 
Consider Paul's rocket mass heater.
 
subject: Question regarding S.O.P from JQ+