Modifier

To class contains:

  private: Just for the class of which defined it. 

  default: For the class of which defined it and the class that in the same package.

  protected: For the class of which definded it and the class that in the same package and the class inherited from it.

  public: Anywhere can get it and use it.

Tip:

  When A class extend B class and B contain private members, A has the private members that inherited from B, but cannot use them.

To class:

  Only public and default can use.

  public: anywhere

  default: must in the same package

 

posted on 2016-12-22 11:18  zawjdbb  阅读(134)  评论(0编辑  收藏  举报

导航