File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes compiler some times does NOT report all errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "compiler some times does NOT report all errors" Watch "compiler some times does NOT report all errors" New topic

compiler some times does NOT report all errors

Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787

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?
Sugata B.

Joined: Sep 29, 2003
Posts: 2
B'coz Java is an interpreted language.
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
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.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: compiler some times does NOT report all errors