hii in one question
class RedException extends Exception {}
class BlueException extends Exception {}
class White {
void m1() throws RedException {throw new RedException();}
public static void main (
String[] args) {
White white = new White();
int a,b,c,d; a = b = c = d = 0;
try {white.m1(); a++;}
catch (RedException e) {b++;}
catch (BlueException e) {c++;}
finally {d++;}
System.out.print(a+","+b+","+c+","+d);
}}
What is the result of attempting to compile and run the program?
a. Prints: 0,1,0,0
b. Prints: 1,1,0,1
c. Prints: 0,1,0,1
d. Prints: 0,1,1,1
e. Prints: 1,1,1,1
f. Compile-time error
g. Run-time error
h. None of the above
with answer : "f" with explanation ...
A compile-time error is generated, because the second catch clause attempts to catch an exception that is never thrown in the try block.
didn't get the point ??
..pls explain