How to use single inheritance in java
In this article we learn single inhetitance by using “has a relationship” ang “is a relationship”.
Now, first of all we write the program by using “has a relationship ” in Single Inheritance.
Step 1: Lets open the notepad and write the following code.
System.out.println(“welcome in java method”);
public static void main(String arg)
Test t=new Test();
Step 2: Name it as “hasrel.java” and save the file in any location. i saved at “C:/kiran/program”.
step 3: Open command prompt(press window +R and write cmd and hit ok).