The answer is, no. Subclasses first implement the methods of the parent class, although the methods and interfaces of the parent class are identical.
class father{ public void F () {}} interface sameinterface{ public void F ();} class son implements sameinterface{ public void F () { //
Note: This overlap may conflict when both the parent class and the interface declare an exception to be thrown. For example, the parent class declares exception 1, and the interface declares exception 2. When a subclass implements a member function, you cannot implement exception 1 or exception 2, and you can choose not to implement the exception.
classException1extendsexception{}classException2extendsexception{}classfather{ Public voidF ()throwsexception1{}}Interfacesameinterface{ Public voidF ()throwsException2;}classSonextendsFatherImplementssameinterface{ Public voidf () {//can only choose not to implement the exception, implementation exception1 or Exception2 will be error }}
The parent class of the Java subclass and the interface to be implemented have the same method/function conflict