In The Following Java Code What Can Directly Access And Change #358
In the following Java code, what can directly access and change the value of the variable name?</p> <pre><code class="language-java" line="1"> package test; class Target { public String name = "hello"; }</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java String Handling - Java Character Extraction - Quiz No.1.
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"; }
any class
only the Target class
any class in the test package
any class that extends Target