java-访问权限

Public:visible to the world.

Protected: visible to the package and all subclasses .

Default: visible to the package. No modifiers are needed.

Private: visible to the class only.

修饰类: Default 或者 public

修饰变量或者方法:四种都可以,但是还是有限制

修饰词本类同一个包的类继承类其他类
private × × ×
无(默认) × ×
protected ×
public

posted on 2020-08-23 08:58  isl-歪歪  阅读(82)  评论(0编辑  收藏  举报

导航