Answer:
It will not compile.As we can see,we have taken 1 interface intf_person, inside interface,we defined 2 method with public access modifiers.
If we compile,then it will give compile error as
"The modifier 'public' is not valid for this item"
Meaning that we can not write public access modifiers inside any interface.Because all the methods inside Interfaces are Public By-default.So we do not have to write Public keyword inside Interface.
Asked In: Many Interviews |
Alert Moderator