multiple inheritance in java -- With the help of interface

Veröffentlicht am: 01 Oktober 2020
auf dem Kanal: Daily Tech Talks
35
4

Multiple Inheritance is a feature of object oriented concept, where a class can inherit properties of more than one parent class. The problem occurs when there exist methods with same signature in both the super classes and subclass. On calling the method, the compiler cannot determine which class method to be called and even on calling which class method gets the priority.
we used interface to perform the multiple inheritance in java programming.
example:-
interface fees
{
int fee=70000;
public void show();
}
interface marks
{
int mark=790;
public void show();
}
class student implements fees,marks
{
String name="Ram";
public void show()
{
System.out.println("Name="+name);
System.out.println("Fees="+fee);
System.out.println("Marks="+mark);
}
}
class multiple
{
public static void main(String args[])
{
student s1=new student();
s1.show();
}
}


Tags- java, java programming , inheritance in java, multiple inheritance with the help of interface, what is interface


Auf dieser Seite können Sie das Online-Video multiple inheritance in java -- With the help of interface mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Daily Tech Talks 01 Oktober 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 35 Mal angesehen und es wurde von 4 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!