Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compiler some times does NOT report all errors

 
Barkat Mardhani
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The compiler (1.4) gives error at line 1 only. Line 2 & 3 are ignored. However, if you resolve line 1 error, 2 & 3 are reported. Any reasons for that behavoir?
Thanks
Barkat
 
Sugata B.
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
B'coz Java is an interpreted language.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there's more than one error possible, the compiler isn't required to report them all. Compilaion is a multi-pass process, and generally the compiler will report all errors it finds in a given pass, but then it will stop. So it tends to find all errors of a given general "type", but ignore the more complex stuff it hasn't gotten around to understanding yet. Which things it reports and which it does not is a complex thing to determine, but it's not one you need to worry about for SCJP. If the compiler could report a given error (assuming no other errors cause compilation to complete prematurely), that's all you really need to know.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic