interface I
{
void m();
}
class B implements I
{
void m()
{
}
}
A) It is wrong.
Method m() should be declared “public” , because every method in interface as default in public. If any child class method should not be weaker than super class, so that’s why an interface child class methods (which are overridden methods of interface) declared as public in the child class.
Comments
Post a Comment