In this article we learn multilevel inheritance by using notepad.
A class can be derived from a derived class which is known as multilevel inheritance.
Step 1: Lets open the notepad and write the following code:
class Test extends A
class demo extends Test
public static void main(String arg)
demo d=new demo();
Step2: In this program we use “extends” for inherit the all properties from base class or parents class.
Step 3: Name it as “multy.java”and save the file in any location i saved at “c:/kiran/program”.
Step 4: Set the path (path set means where you save your java file).
Step 5: Now write the following code for checking my java file is compiling or not.
My java program compiled successfully.
Step 6: write the following code in command prompt. press enter and see the output.
// demo is a class name which is written in my “multy.java” file.