Which line does not result in a compile-time error? a. 1 b. 2 c. 3 d. 4 e. None of the above I would say d but apparently the answer is a. Surely abstract + final is a big no no!? [ November 17, 2003: Message edited by: Eddie Long ]
When you copile the above code why the error is shown first in the line 3 and then in line 2 and then in line 4. Why the error is not in the following order error in line 2 error in line 3 error in line 4 As compiler compiles the first error it will encounter it should report the first error and then the second error. Then why line 3 is the first error it encountered instead of line 2 error. Can someone tell me why it is like this?
Sun's trying to turn me into a walking compiler! otherwise i don't see how spotting that kind of mistake makes you a better Java Programmer
The idea is not to learn how to spot mistakes as well as the compiler. The idea is to learn the proper use of each modifier. A programmer is far more likely to use modifiers effectively when the rules are known. Furthermore, learning the rules will help a programmer write quality code and write it quickly. A programmer that depends on coaching from the compiler is unlikely to be as productive as a programmer that does not need the coaching. Anup, I am not an expert on compilers, but I do know that most compilers do the job using multiple passes. I assume that the order of the error messages is influenced by the multiple pass approach to compilation.
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad: