(Public private Dian Dian protected) understanding

  • public (public): public class member can be accessed from anywhere.
  • protected (Protected): protected class members can be accessed by itself and its parent class and subclass.
  • : private (private) class to access private members of the class can only be located in its definition.

 

    Subclass inherits from the parent class there over private members and methods are not able to be called by subclasses

Guess you like

Origin www.cnblogs.com/caijiqi190731/p/11287097.html