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,不知道是不是這個原因,回家去試試.. - -!

------------------------------------------------------------------------------------
回來試了試好像也不行,那位兄弟知道原因通知一下...- -!
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章