0
How to solve diamond problem with respect to this question
8 Respostas
+ 2
Ajoh Pv
To solve diamond problem you have to create "default" method not "abstract" method because interface abstract method can not have method body
https://code.sololearn.com/cRffHX3lFIEg/?ref=app
+ 1
Ajoh Pv
Ok means when multiple inheritance is not possible then we use interfaces.
We can achieve multiple inheritance using interface
+ 1
Ajoh Pv
Interface should not have method body. We just use interfaces to define abstract method which can be implement in a class but this abstract method can not have method body.
0
What is diamond problem?
0
When you
can't inherit from two classes to a subclass(diamond problem)then you inherit a method from interfaces to a class
I am not able to solve this issue here
0
K thanks
0
What is super ? Why is it used
0
Ajoh Pv
As this represents current class object same super represents parent class object.
super is used to access parent class members.