It's not a secret anymore!
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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

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
Can anyone please explain?
Thank You
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.
ratul banji
Ranch Hand

Joined: Mar 15, 2001
Posts: 108
I ran it in JDK 1.2.1
It is not working.
I agree. Here's the link:
subject: Question regarding S.O.P from JQ+
It's not a secret anymore!