One of the answer I found was "multiple inheritance can lead to conflicts if two methods/variable belonging to two different classes have the same name". But I think there can be conflict while implementing multiple interfaces as well. For eg consider a class implementing two interfaces having same variable name(variables can be defined in an interface and they are final by default) declared inside them
interface Ainterface {
public final static int i=10;
}
class InterfaceCheck implements Ainterface {
public static void main(String[] args) {
System.out.println(i);
}
}
The above code works perfectly fine
interface Ainterface {
public final static int i=10;
}
interface Binterface {
public static final int i=20;
}
class InterfaceCheck implements Ainterface,Binterface {
public static void main(String[] args) {
System.out.println(i);
}
}
As per the sources on the internet "implementing multiple interfaces can never lead to conflict" But the above code produces an error. So this is the conflict I am talking about.