java override private method

Spread the love

Thats bad: lets say this method doesnt exist at first in Base. Reproduced courtesy of Bruce Eckel, MindView, Inc. But to not allow a parent's private method to be "overridden" is something different, and necessary to ensure encapsulation. main method java string argument error given then But now, this is leaks implementation information through the encapsulation, because a derived class now cannot create a method hasCredentials any more it would clash with the one defined in the base class. override BoxAdcontent.document.write("BC"); I think the question stems from a misunderstanding: How is it /not/ a violation of encapsulation to not allow a parent's private method to be "overridden" (ie, implemented independently, with the same signature, in a child class). Its public interface doesnt change (and neither do its invariants) so we must expect that it doesnt break existing code.

If not reflection, does anyone know of another way of doing it?

BoxAdcontent.document.write("