Timeline for Did Java avoid multiple inheritance here?
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 23, 2014 at 13:52 | answer | added | Random42 | timeline score: 5 | |
| Nov 23, 2014 at 13:28 | comment | added | Random42 | @raptortech97 Actually the above code will compile using a Java 8 compiler. | |
| Nov 23, 2014 at 8:14 | comment | added | toniedzwiedz | @raptortech97 this isn't true. Every such definition in an interface is just implicitly public static final. The value of item cannot be changed and it can be accessed like this: SuperType2.item. I wouldn't overuse it though and the naming conventions are off. Without the ambiguity, s.item would also work but this is not the right way to access this constant and most code analysis tools will consider it a violation. The code does not compile because of the assignment of a double 2.0 to a float (loss of precision) and the ambiguous use of s.item. | |
| Nov 23, 2014 at 7:31 | review | Close votes | |||
| Dec 1, 2014 at 3:04 | |||||
| Nov 23, 2014 at 3:09 | comment | added | Robert Harvey | Java omits multiple class inheritance, but allows multiple interface inheritance. This is how Java has always worked. | |
| Nov 23, 2014 at 2:57 | history | asked | overexchange | CC BY-SA 3.0 |