/Java_21_Inheritance_Tracing_Exercise_1

A program demonstrating the use of Super class and Method in inheritance and how i would affect in calling other classes! this exercise is good for tracing and finding the output!

Primary LanguageJava

Java_21_Inheritance_Tracing_Exercise_1

This exercise uses classes without data (“utility-type” classes).

Rules used in tracing this code:

1- Analyze one-by-one the statements in main()

The first thing the constructor of a subclass will do is to call the constructor of the superclass; when there is no such call in the code, the default super() will automatically be called;

this(0); is the constructor of the current class with the parameter 0

s.poit(s2); means the method poit(s2) of a Bird object, with the parameter s2 of Loony type; this means that the control will go to the method narf() of Loony class.