Java中四种修饰符的限制范围

四种修饰符的访问权限范围如下:

修饰符

同一个类

同一个包

不同包的子类

不同包的非子类

public

protected

默认(default)

private

Last updated