I found this Question while preparing for
OCAJP
Q.
How can you fix the following code to make it compile:
Assume that changes suggested in a option are to be applied independent of other options.
Options:
A>Change doStuff in Amazing to throw only IllegalArgumentException.
B>Change doStuff in Great to throw only FileNotFoundException as well as IllegalArgumentException.
C>Change doStuff in Amazing to throw only IOException.
D>Change doStuff in Great to throw only IOException instead of FileNotFoundException.
E>Replace g.doStuff() to ((Amazing) g).doStuff().
Corrent Answers are A and D. But, why can't it be C and D?