Posts

Showing posts from April, 2022

Class Inheritance

Image
    Introduction:    We will cover the following basic concepts: Understand the basics of Class Inheritance. Simple example class to understand how we can work with Class Inheritance in different scenarios. We will see the use of SUPER and ME keywords in the context of Inheritance. Create a program to demonstrate the different ways to call methods using Inheritance. Why Class Inheritance? Lets Start 1. Let us create the below comparison chart to understand the basics of  CLASS INHERITANCE. Basic Inheritance Tree Inheritance Basic Comparison Table 2. Lets us create a simple eclipse class and make it work for different scenarios. We will add one method in each visibility section of the Eclipse Class as shown below. PUBLIC_METHOD, PROTECTED_METHOD, and PRIVATE METHOD. Now let us create the implementations for the created methods. Here we have created a FINAL CLASS ( i.e. add the FINAL keyword in the definition section of the class) just to see what happens if we ...