Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Valentin's Question 38

 
Steve Lovelace
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given this code:the desired answser is:
Compilation error on lines 1 and 4.
However, under 1.4.1-b21 anyway, this code compiles and runs just fine.
[ September 18, 2003: Message edited by: Steve Lovelace ]
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steve,
You are right, the code runs under 1.4.1-b21.
But the thing is that the only authoritative document you should count on is the Java specification and not the different Java implementations. JLS 14.20 Unreachable statements says that the code in question 38 should not compile.
I hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic