Home / MCQ Bank / Computer
Computer Inheritence Difficulty: Medium

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(); } }

Select the correct option to test your answer:

More Computer Questions

What will be the output of the following Python code? print("Hello {name1} and {name2}".format(name1='foo', name2='bin')) What is method hiding in Java? While Finding and Replacing some data in Excel, which of the following statement is valid? Which is the method to look up the objects for a range of keys? What data structure is used for efficiently managing a collection of ordered elements where insertions and deletions are frequent?