This compiles:
class Ex1 {
    public int show() {
        try {
            int a=10/10;
            return 10;
        }   
        catch(ArithmeticException e) {
            System.out.println(e);
        }
        finally {
            System.out.println("Finally");
        }
        System.out.println("hello");
        return 20;
    }
}
on the other hand this doesn't:
class Ex15 {
    public int show() {
        try {
            int a=10/0;
            return 10;
        }
        catch(ArithmeticException e) {
            System.out.println(e);
        }
        finally {
            System.out.println("Finally");
            return 40;
        }
        System.out.println("hello");
        return 20;
    }
}
and gives unreachable statement System.out.println("hello"); error. why is it so?
 
     
     
     
     
     
     
    
block, it's really hard to read – pablochan Mar 23 '10 at 17:40