1Z0-803 · Question #32
Give: Public Class Test { } Which two packages are automatically imported into the java source file by the java compiler?
The correct answer is A. Java.lang E. The package with no name. For convenience, the Java compiler automatically imports three entire packages for each source file: (1) the package with no name, (2) the java.lang package, and (3) the current package (the package for the current file). Note: Packages in the Java language itself begin withjava.
Question
Give:
Public Class Test { } Which two packages are automatically imported into the java source file by the java compiler?
Options
- AJava.lang
- BJava.awt
- CJavax.net
- DJava.*
- EThe package with no name
How the community answered
(47 responses)- A91% (43)
- B2% (1)
- C4% (2)
- D2% (1)
Explanation
For convenience, the Java compiler automatically imports three entire packages for each source file: (1) the package with no name, (2) the java.lang package, and (3) the current package (the package for the current file). Note: Packages in the Java language itself begin withjava.orjavax. Incorrect answers: Java.awt: basic hierarchy of packages for native GUI components Javax.net: networking operations, sockets, DNS lookups, etc.
Topics
Community Discussion
No community discussion yet for this question.