What is the output of the following application?
package mypkg; /* w ww . j a va 2 s . co m*/ public class Main { public static void main(String... teams) { try { int score = 1; System.out.print(score++); } catch (Throwable t) { System.out.print(score++); } finally { System.out.print(score++); } System.out.print(score++); } }
D.
The application does not compile because score is defined only within the try block.
The correct answer is Option D.