Hi guys. The following example is based on exercice 71 p.179 from OCA/OCP Practice
Test of Scott and Jeanne.
The exercice asks about how many lines of the application does not compile. Well, in the code below i will transcribe the application and I make a change on line 13 by adding a new error changing the original name of the variable "ex" by "e".
So, leaving the code like this and running javac commmand, compiler says that there is an error on line 13:
Test.java:13: error: variable e is already defined in method make()
} catch(Exception e){
But besides this error i know there are another two on lines 10 and 23. And a proof of this is that if i fix the error from line 13, and then i run again javac, now the compiler will say that there are two compiler errors on those two lines (10 and 23).
So what would be the right answer for the exam?.
* There are one compiler error (based on what originally compiler says)
* There are three compiler errors based on what we can see about the code.