java | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 2

java

what is the diamond problem in java??

3rd Oct 2018, 2:27 PM
Sphoorti Pipley
Sphoorti Pipley - avatar
1 ответ
+ 1
The “diamond problem” is a problem of multiple inheritance of state. Multiple Inheritance: a class can inherit properties and methods of more than one parent class. The diamond 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. In Java, however, multiple inheritance is not allowed for classes, only for interfaces, and these do not contain state.
3rd Oct 2018, 8:16 PM
asa22