package javaapplication13;
class calculator1
{
public int sum(int a,int b)
{
return a+b;
}
}
class calculator2 extends calculator1
{
public int sub(int a,int b)
{
return a-b;
}
}
class calculator3 extends calculator2
{
public int mul(int a,int b)
{
return a*b;
}
}
public class JavaApplication13 {
public static void main(String[] args)
{
int r;
calculator2 c=new calculator3();
r= c.sum(9, 9);
System.out.println(r);
r=c.sub(9,9);
System.out.println(r);
}
}
No comments:
Post a Comment