第一章 单元测试

1、单选题:
Which edition of Java is geared toward developing large-scale, distributed networking applications and web-based applications? ( )
选项:
A:Standard Edition.
B:Micro Edition.
C:Enterprise Edition.
D:Industrial Edition.
答案: 【Enterprise Edition.

2、单选题:
Java was originally developed for: ( )
选项:
A:Intelligent consumer devices.
B:Distributed computing.
C:Operating systems development.
D:Personal computers.
答案: 【Intelligent consumer devices.

3、单选题:
Which of the following statements about Java Class Libraries is false: ( )
选项:
A:An advantage of using Java class libraries is saving the effort of designing, developing and testing new classes.
B:Java class libraries are not portable
C:Java class libraries are also known as Java APIs (Application Programming Interfaces).
D:Java class libraries consist of classes that consist of methods that perform tasks.
答案: 【Java class libraries are not portable

4、单选题:
The .class extension on a file means that the file: ( )
选项:
A:is produced by the Java compiler (javac).
B:Contains HTML
C:None of the above.
D:Contains java source code
答案: 【is produced by the Java compiler (javac).

5、单选题:
The command ________ executes a Java application. ( )
选项:
A:javac
B:java
C:None of the above
D:run
答案: 【java

第二章 单元测试

1、单选题:
End-of-line comments that should be ignored by the compiler are denoted using ( )
选项:
A:A slash and two stars ( /** ).
B:A slash and a star ( /* ).
C:Three forward slashes ( /// ).
D:Two forward slashes ( // ).
答案: 【Two forward slashes ( // ).

2、单选题:
Which of the following is not a valid Java identifier? ( )
选项:
A:m_x
B:$_AAA1
C:my Value
D:width
答案: 【my Value

3、单选题:
Which of the following cannot cause a syntax error to be reported by the Java compiler? ( )
选项:
A:An extra blank line.
B:Missing */ in a comment that begins with /*
C:Mismatched
D:Missing ;
答案: 【An extra blank line.

4、单选题:
Which of the following does not contain a syntax error? ( )
选项:
A:System.out.println( "Hello 回车换行world!" );
B:System.out.println( Hello world! );
C:System.out.println( 'Hello world!' ):
D:System.out.println( "Hello world!" );
答案: 【System.out.println( "Hello world!" );

5、单选题:
Which command compiles the Java source code file Welcome.java? ( )
选项:
A:cd Welcome.java
B:java Welcome.java
C:javac Welcome.java
D:compile Welcome.java
答案: 【javac Welcome.java

6、单选题:
Which command executes the Java class file Welcome.class? ( )
选项:
A:java Welcome
B:java welcome
C:java Welcome.class
D:run Welcome.class
答案: 【java Welcome

7、单选题:
Which is the output of the following statements?
( )
选项:
A:Hello World
B:HelloWorld
C:HelloWorld
D:World Hello
答案: 【Hello World

8、单选题:
Which statement prints the floating-point value 123.456 right justified with a field width of 10? ( )
选项:
A:System.out.printf("%10.3f", 123.456);
B:System.out.printf("%d10.3", 123.456);
C:System.out.printf("%10.3d", 123.456);
D:System.out.printf("%f10.3", 123.456);
答案: 【System.out.printf("%10.3f", 123.456);

9、单选题:
What is the size in bits of an int? ( )
选项:
A:32
B:16
C:8
D:64
答案: 【32

10、单选题:
Which of the following is the escape character? ( )
选项:
A:n
B:*
C:"
D:
答案: 【

发表评论

电子邮件地址不会被公开。 必填项已用*标注