关于Java的软件包,以下哪项是正确的?
1) Every class is part of some package.
2) All classes in a file are part of the same package.
3) If no package is specified, the classes in the file
go into a special unnamed package
4) If no package is specified, a new package is created with
folder name of class and the class is put in this package.
(A)仅1、2和3
(B)仅1、2和4
(C)只有4
(D)仅1和3答案: (A)
说明:在Java,包可以视为等同于C++语言的名称空间。
这个问题的测验