Static Interface Methods Aren't Inherited by Subclasses
You can't access static methods of interfaces through instances. You have to access them statically. This is a bit different from classes where accessing a static method through an instance is allowed, but often flagged as a code smell; static methods should be accessed statically.
That's because static methods of classes are inherited by subclasses, but static methods of interfaces aren't. That's stated in §8.4.8 of the specification:
…
A class does not inherit static methods from its superinterfaces.
When you are looking up the accessible methods for the instance, the static method from the interface isn't among them.
Options for the code
So, as the code is now, you need to access the method statically:
AWD.isRearWheelDrive()
However, it seems like you want this to be an instance method, in which case you should probably be using a default method that returns false:
interface AWD {
default boolean isRearWheelDrive() {
return false;
}
}
Even that seems a little bit odd, though. It seems like you'd probably want that default method to be overriding some non-default method in a super-interface. That is, you probably want something like:
interface HasDriveWheels {
boolean isRearWheelDrive();
}
interface AllWheelDrive extends HasDriveWheels {
@Override
default boolean isRearWheelDrive() {
return false;
}
}