package overriding; class Super3 { void testDivide(int i, int j) throws Exception { double p = i / j; System.out.println("p in Super =" + p); } } public class TestOverrideSub3 extends Super3 { void testDivide(int i, int j) throws ArithmeticException { double p = i / j; System.out.println("p in Sub =" + p); } public static void main(String[] args) { Super3 s3 = new TestOverrideSub3(); try { s3.testDivide(10, 5); } catch (Exception e) { System.out.println("Exception " + e.getMessage()); } } }