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
Joined: Sep 29, 2003
B'coz Java is an interpreted language.
Joined: Jan 30, 2000
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.