Vidyalelo
Java Programming · Q93

Strings

Programming · Java Programming · question 93

Q93

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
Answer
D.
any class that extends Target

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board