Java权限修饰符public、protected、default(缺省)、private的区别

778 阅读1分钟

public作用域:当前类、同包、子类、其他包
protected作用域:当前类、同包、子类
default(缺省)作用域:当前类、同包
private作用域:当前类