Following code will result in: class A { public static void main(String [] args) {B b = new A(); }} class B extends A {}

  1. Compile error

  2. Runtime Exception

  3. No error

  4. Compile error. Type mismatch: cannot convert from A to B


Correct Option: D

Find more quizzes: