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 .  Class A method
B .  Class B method
C .  Compilation Error
D .  Runtime Error
E .  None of these
Answer: Option A

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