PrepZone Logo
PrepZone
Back to Java

Java · Hard

What happens if two interfaces define the same default method?

JavaOOPInterfacesJava 8+

Answer preview

If a class implements two interfaces with the same default method signature, the code will not compile until the class explicitly overrides the conflicting method.…