Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JQ + Question ID :958011966030

 
huiying li
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The answer given is none of the three lines will compile, however, using JDK 1.3, all three did compile and here are the output.

C:\JavaRanch>javac Test34.java
C:\JavaRanch>java Test34
nulltrue
truenull
nullnull
Any thoughts?
 
Subramaniam Venkatesan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
None of the 3 lines compiled in jdk1.2.2
got these errors

but got truenull or the o/p you mentioned
in these codes
 
Stevie Kaligis
Ranch Hand
Posts: 400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,
I was about to ask the same question,
it suppose to be compiled and run without any problem,
if this topic is related to JDK 1.0 and 1.1, than JQPlus was right,
but for JDK 1.2 and 1.3, it works without any problem.
 
huiying li
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replies, hopefully there won't be something ambiguous like this in the real test.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic