`
fantasybei
  • 浏览: 36729 次
  • 性别: Icon_minigender_1
  • 来自: 农村进沪务工人员
社区版块
存档分类
最新评论

Class access

阅读更多
However, if a static member of that class(class which has no access specifier) is
public, the client programmer can still access that static member even
though they cannot create an object of that class

做了下验证,如下:
package test.aaa;
class A {
	public static String TEST = "A";
}

package test;
public class C {
	public static void main(String[] args){
		System.out.println(test.aaa.A.TEST);
	}
}


但是eclipse下提示The type test.aaa.A is not visible,thinking in java第三版是讲jdk1.5的,我用的是1.4,不知道是不是这个原因,回家去试试.. - -!

------------------------------------------------------------------------------------
回来试了试好像也不行,那位兄弟知道原因通知一下...- -!
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics