Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question regarding S.O.P from JQ+

 
Rahul Ramachandran
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ran it in JDK 1.2.1
It is not working.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic