You got it. Now occasionally, I've needed to access a protected method. Not sure if this is where you're going but...
If you do, then what I've done (rather that change the visibility...cuz unless you have the source code you can't) is to create a subclass(B) of the class(A) that contains the protected method. Then add a public method to the subclass(B) that calls the protected method defined in class(A). Then you can use subclass(B) instead of class(A) and be able to call the protected class(A) method by calling the the public subclass(B) method.
Scott
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement