JPR Test: Multiple Inheritance in Java
JPR Test: Multiple Inheritance in Java
Class test :
M1, M2
import [Link].*;
interface sports
class student
int rn;
String n;
rn=[Link]([Link]());
n=[Link]();
[Link]("Name : "+n);
int m1,m2;
{ display();
m1=[Link]([Link]());
[Link]("Enter marks of class test 2 : ");
m2=[Link]([Link]());
class p28
ob1.display1();
Output :
Class Student :
Rn, n
Class test :
M1 , m2
Class result : Interface sports:
total Spmarks=5
import [Link].*;
interface sports
class student
int rn;
String n;
rn=[Link]([Link]());
n=[Link]();
[Link]("Name : "+n);
int m1,m2;
{ display();
m1=[Link]([Link]());
m2=[Link]([Link]());
}
}
int total;
{ display1();
total=m1+m2+spmarks;
[Link]("Total : "+total);
class p28
ob1.display2();
Output :