If you have a class that implements several interfaces, and these interfaces contain methods with a similar method signature (for example, your startEngine method).
To find out which method you are calling, follow these steps:
yourInterface.super.method();
You can see the link, which will also solve your question.
So you can also do this:
public class FlyingCar implements FlyCar, OperateCar{ public int startEngine(EncryptedKey key) { return FlyCar.super.startEngine(key); } }
Or that:
public class FlyingCar implements FlyCar, OperateCar{ public int startEngine(EncryptedKey key) { return Operate.super.startEngine(key); } }
In any case, you need to specify the interface from which you are calling the method, if you are just calling the method from the interface.
However, this particular situation is an example of a cause. What will be more likely is that you will do something like this:
public int startEngine(EncryptedKey key) {
This is also true. However, if you have two interfaces with a method that has an identical signature, it could also be a situation where you must have one parent interface that declares this method, and two child interfaces that extend it:
public interface Car {
source share