Java中共有三种修饰符,四种权限控制范围:

范围从大到小依次为:

public - 对外公开

protected - 继承可见

无修饰符 - 包内可见

private - 类内可见

相关文章: