Sail E0 Webinar
Question
What will be the output?
class Parent{
public void method(){
System.out.println("Hi i am parent");
}
}
public class Child extends Parent{
protected void method(){
System.out.println("Hi i am Child");
}
public static void main(String args[]){
Child child = new Child();
child.method();
}
}
Options:
A .  Compiles successfully and print
B .  Compiles successfully and print
C .  Compile time error
D .  Run Time error
E .  None of This
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 *

More Questions on This Topic :


Latest Videos

Latest Test Papers