How to use single inheritance in java

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.
//Code

class Test
{
void show()
{
System.out.println(“welcome in java method”);
}
}
class demo
{
public static void main(String arg[])
{
Test t=new Test();
t.show();
}
}

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).