Sail E0 Webinar
Question
What will be the output?class A{static void method(){System.out.println("Class A method");}}class B extends A{static void method(){System.out.println("Class B method");}}public class Test{public static void main(String args[]){A a = new B();a.method();}}
Options:
A .  Runtime Error
B .  Class B method
C .  Class A method
D .  Compilation Error
E .  None of these
Answer: Option C

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers