Is the access visibility of implicit inherited methods (parent's abstract final methods inherited on children) always the same when accessed through child?
What are the implicit forwarded rules?
class package0.Parent {ACCESS_MODIFIER final void f();}
class package1.B extends A { /* Implicit f?*/}
class package2.C extends B {/* Implicit f? */}
Then: Will always ACCESS_MODIFIER
be forwarded? If so, why case 1?. And what about case 3?
- Case 1: If parent
f()
isprivate
visibility is not forwarded, asB
cannot see it. - Case 2: If parent
f()
ispublic
, I guess anyone who usesB
orC
will have availability onf
. - Case 3: If parent
f()
isprotected
, I guessB
will "expose" the method as protected, which meansC
can see it.
Your wording is semi-unclear. The way I'm interpreting your question is:
If so, the answer is yes:
C
would be able to accessf
.