项目实践精解:Java核心技术应用开发
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人

思考题(Review Questions)

1.(Level 1)Which environment variables need to be set?

(级别1)我们需要配置哪些与Java相关的环境变量?

2.(Level 1)What are the advantages of Java Language? Why Java have them?

(级别1)Java语言有哪些优点?为什么?

3.(Level 1)Which JDK tools can be used to compile and run a Java program?

(级别1)在JDK工具中,哪个工具用来编译Java程序?哪个工具用来运行Java程序?

4.(Level 1)What are the basic packages in Java?

(级别1)Java中有哪些基本的开发包?

5.(Level 1)If all three top-level elements occur in a source file, they must appear in which order:

(级别1)如果3个元素同时出现,那么它们的顺序应该是:

A.Imports, package declarations, classes

B.Classes, imports, package declarations

C.package declarations;order for imports and classes doesn’t matter

D.package declarations, imports, classes

6.(Level 2)Which of the following signatures are valid for the main() method?

(级别2)main()方法的签名应该是下面哪一个?

A.public static void main()

B.public static void main(String[ ] args)

C.public void main(String[ ] args)

D.public static int main(String[ ] args)

7.(Level 3)How can you force garbage collection of an object?

(级别3)如何强制执行垃圾回收器?

A.Garbage collection can not be forced

B.Call System.gc()

C.Call System.gc(), passing in a reference to the object to be collected

D.Call Runtime.gc()