interface honda {
void meth();
protected void meth2();
}
class crv : honda {
void honda.meth() { } //public not allowed
void honda.meth2() { } //protected not allowed
}
I gave interface honda that has 2 abstract methods:
meth(); which is public
meth2(); which is protected
Whay do I get an error when i say public void honda.meth(){} or protected honda.meth2() { } in the implementing class crv?
I mean i have one assumption: It is beacuse by doing this, we provide default implementation for the method, so It is like in the interface but It is not. This assumption wpuld justify the error when I say public void honda.meth(){} but it does not justify the error whjen I try to say protected honda.meth2() { } since the meth2() is protected in the interface.
Could you please help me?