Which methods can a subclass inherit in Java?
问题 Sorry I am a newbie to Java. I am trying to get my head around inheritance and subclass/superclass relationships in Java. If classA is a subclass of classB, will classA's protocol feature all methods that belong to classA or only those declared public and package? Can classA's protocol feature private methods inherited from its superclass ClassB? 回答1: Firstly, the word "inherited" isn't quite the right term. You mean "visible". public and protected are always visible private is not visible