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 .  Run Time error
D .  Compile time error
E .  None of This
Answer: Option D

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