To Design a class to implement multiple inheritance
import java.util.*;
class Num1
{
int n;
void getdata()
{
Scanner s=new Scanner(System.in);
System.out.print("Enter a Number :");
n=s.nextInt();
}
}
interface result
{
void display();
}
class squareNum extends Num1 implements result
{
public void display()
{
System.out.println("Square Numbers are ");
for(int i=0;i<=n;i++)
{
int sq=i*i;
System.out.println(i+"\t="+sq);
}
}
public static void main(String args[])
{
squareNum sn=new squareNum();
sn.getdata();
sn.display();
}
}