THE JAVA PROGRAM TO ILLUSTRATE THE USE OF SUB CLASSES

import java.lang.*;
class parent
{
int m;
void get_m(int m)
{
this.m=m;
}
void display_m()
{
System.out.println("this is the parent:M" + m);
}
}

class child extends parent
{

int n;
void get_n(int n)
{
this.n=n;
}

void display_n()
{
System.out.println("this is from chils:N" + n);
}
}

class jlab4
{
public static void main(String args[])
{
child c=new child();
c.get_m(20);
c.get_n(10);
c.display_m();
c.display_n();
}
}