Question: Given the code below answer these questions. A. Is the use of the method showme in the Testinherit class an example of overloading or overriding?

 Given the code below answer these questions. A. Is the useof the method showme in the Testinherit class an example of overloading

Given the code below answer these questions. A. Is the use of the method showme in the Testinherit class an example of overloading or overriding? B. Which class is the parent or super and which class is the child or sub class? C. Write one line of code in the showme method of Testlnherit that will invoke or call the showme method of class Inherit. D. Write a constructor the class TestInherit that invokes the constructor for Inherit that has one parameter. 13 14 1 class Inherit 2 { 3 public Inherit() 4 { 5 System.out.println("Created Inherit"); 6 } 7 public Inherit(int one) 8 { 9 System.out.println("Created Inherit" + one) ; 10 } 11 void showme () 12 { System.out.println("I am in showme of Inherit"); } 15 16 } // end of Inherit 17 public class TestInherit extends Inherit 18 { 19 void showme () 20 { 21 System.out.println("I am in showme of TestInherit"); 22 } 23 public static void main(String[] args) 24 { 25 Inherit i = new Inherit(); 26 TestInherit ti = new TestInherit(); 27 // Now call each showme 28 i.showme(); 29 ti.showme(); 30 } 31 }// end of TestInherit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!