日期:2014-05-18  浏览次数:20692 次

求助一个ocjp的问题??
package test;

class Target {
  public String name = "hello";
}
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
Answer: C

为什么是c啊,name是public的,应该任何类都可以吧?
------解决方案--------------------
public   class Target