I do not understand why we need to declare the String type with the method onPress() and parameter Object o. It works perfectly fine without it so why do we have to insert this additional code?
Why do we need to declare the method with String type?
You must be signed in to leave a comment
30 March 2020, 00:42
Ideally they are trying to show inheritance in interfaces. So the question asks to remove all incorrect lines of the Button Interface. So any private and protected access modifiers can't be used in interface . We can override the interface parent method and also we can overload the methods found in the parent interface. So ideally String onPress(Object o) is valid statement since it has different method signature as that found in parent interface.