Java Interface Default Method Execution

Report a typo

If you have an interface in Java with a default method and two classes ClassA and ClassB implement this interface but ClassB overrides the default method. What will be the output when the following code is executed?

InterfaceName objA = new ClassA();
InterfaceName objB = new ClassB();
objA.defaultMethod();
objB.defaultMethod();
Select one option from the list
___

Create a free account to access the full topic