Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 177
  • package overriding; class Super3 { void testDivide(int i, i...

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()); } } }

technology programming languages
  1. p in Super =2.0

  2. p in Sub =2.0

  3. Compiler error

  4. Exception


Show answer
Correct Option: B

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy