What can directly access and change the value of the variable name?

Given:
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?

Given:
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.
only the Target class

B.
any class that extends Target

C.
any class

D.
any class in the test package



Leave a Reply 0

Your email address will not be published. Required fields are marked *