Multiple Inheritance
interface xxx{
public void sum();
}
class data
{
double x=4,y=7;
}
class iheritance_final extends data implements xxx
{
public void sum()
{
double sum1=x+y;
System.out.println("Sum is :"+sum1);
}
public static void main(String[] arg)
{
iheritance_final f=new iheritance_final();
f.sum();
}
}
No comments:
Post a Comment