Exp 6
********Exp 6: Concept of multiple inheritance***********
package rk;
public class multpinheritance {
public static void main(String[] args) {
// TODO Auto-generated method stub
termwork obj=new termwork();
obj.display();
}
}
class student
{
int S =22;
}
class percentage extends student
{
int P=78;
}
interface Grade
{
char a= 'A';
}
class termwork extends percentage implements Grade
{
void display()
{
System.out.println("Seat No. of the student is :"+S);
System.out.println("Grade :"+a);
System.out.println("Percentage :"+P+"%");
}
}
******OUTPUT*****
Seat No. of the student is :22
Grade :A
Percentage :78%
package rk;
public class multpinheritance {
public static void main(String[] args) {
// TODO Auto-generated method stub
termwork obj=new termwork();
obj.display();
}
}
class student
{
int S =22;
}
class percentage extends student
{
int P=78;
}
interface Grade
{
char a= 'A';
}
class termwork extends percentage implements Grade
{
void display()
{
System.out.println("Seat No. of the student is :"+S);
System.out.println("Grade :"+a);
System.out.println("Percentage :"+P+"%");
}
}
******OUTPUT*****
Seat No. of the student is :22
Grade :A
Percentage :78%
Comments
Post a Comment