1. package test;
2.
3. class Target{
4. public String name = "hello";
5. }
What can directly access and change the value of the variable name?
A. any class
B. only the Target class
C. any class in the test package
D. any class that extends Target
答案:C
參考:7-3 存取修飾詞的使用
-------------------------------------------------------------------
誰可存取name這一個變數?
C. any class in the test package
沒有留言:
張貼留言