早教吧 育儿知识 作业答案 考试题库 百科 知识分享

修饰符权限,你说改选什么才是呢?1.packagetest;2.3.classTarget{4.publicStringname="hello";5.}Whatcandirectlyaccessandchangethevalueofthevariablename?A.anyclassB.onlytheTargetclassC.anyclassinthetestpac

题目详情
修饰符权限,你说改选什么才是呢?
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. any class
B. only the Target class
C. any class in the test package
D. any class that extends Target
▼优质解答
答案和解析
没有public是代表本包内的可以访问,所以选C