See you at JVMLS

Palo Marton palo.marton at gmail.com
Thu Aug 20 11:47:36 UTC 2015


> This would be a compile time (or JVM link time) error as this interface
> extends 2 classes.
>

Sorry, I overlook that in your example E is a class (above reaction was for
interface E extends I,J). But anyway this will be also a compile time
error. Rule for classes could be: lass can implement an interface only if
it extends the same class as interface (or subclass of that class). So
these are OK
class E extends C implements I {}
class F extends D implements J {}

This is error:
class E implements I {}

Rules for interfaces would be that you can write any number of interfaces
and max 1 class in "extends", but in the end it must be resolved in a way
that interface extends exactly one class. If there is a class in "extends",
it is that class. If there are interfaces in "extends" that themselves
extend classes, then situation is checked for conflicts and the most
specific class is taken as "superclass" for the interface.



More information about the valhalla-dev mailing list