public class Sub {
static int read (int i) {
try {
if (i<5) return 5/i ;
else return i*5 ;
} catch (ArithmeticException e) {
System.out.println ("ArithmeticException") ;
} finally {
System.out.println("Finally");
return i+100 ; // look here
}
}
public static void main (
String [ ] args) {
System.out.println (read(4)) ;
System.out.println (read(10)) ;
}
}
Why does it give a compile time error if return i+100 is commented when one of the above return statements are going to be executed