标签:
下面我简单的画一张表来说明问题:
作用域(可见) | 当前类 | 同包 | 子孙类 | 其他包 |
public | √ | √ | √ | √ |
protected | √ | √ | √ | × |
default(friendly) | √ | √ | × | × |
private | √ | × | × | × |
java作用域public protected private,以及不写时的区别
标签:
原文地址:http://blog.csdn.net/uniquewonderq/article/details/46407891