Can someone explain "the strict default-abstract and default-default conflict rules" mentioned in the JLS §8.4.8.4.
Are they defined in the JLS? I can't seem to find their definition.
I could be wrong, but this is how I interpreted that section.
"default-default" and "default-abstract" are not keywords. They describe two different compilation conflict rules pertaining to default methods in interface.
"default-default" pertaining to a class implementing two or more interfaces that provide default implementations of override equivalent methods while not providing it's own implementation.
"default-abstract" pertaining to a class implementing one interface that provides a default implementation and one or more interfaces not providing default implementations of override equivalent methods.
The exception to these two rules is if a super class of the class in question specifies an abstract method that is override equivalent which trumps the definitions found in any implementing interface.
If the class inherits a concrete override equivalent method from a super class or defines its own then none of these conflicts apply.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With