In the following Java code, what can directly access and change the value of the variable name?

package test;
class Target 
{
 public String name = "hello";
}

a) any class
b) only the Target class
c) any class in the test package
d) any class that extends Target

1 thought on “In the following Java code, what can directly access and change the value of the variable name?”

Leave a Comment