第一章 单元测试

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

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

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

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

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

第二章 单元测试

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

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

3、 问题:Which of the following cannot cause a syntax error to be reported by the Java compiler? ( )
选项:
A:Mismatched {}
B:Missing / in a comment that begins with /
C:Missing ;
D:An extra blank line.
答案: 【
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:javac Welcome.java
C:java 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.class
C:java Welcome
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("%d10.3", 123.456);
B:System.out.printf("%10.3d", 123.456);
C:System.out.printf("%f10.3", 123.456);
D:System.out.printf("%10.3f", 123.456);
答案: 【
System.out.printf("%10.3f", 123.456);

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

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

第三章 单元测试

1、 问题:Which of the following can be used in a switch statement in the expression after keyword case?a.a constant integral expression.b.a character constant.c.a Stringd.an enumeration constant. ( )
选项:
A:a and b.
B:a and c
C:b and c
D:All.
答案: 【
All.

本门课程剩余章节答案为付费内容
本文章不含期末不含主观题!!
本文章不含期末不含主观题!!
支付后可长期查看
有疑问请添加客服QQ 2356025045反馈
如遇卡顿看不了请换个浏览器即可打开
请看清楚了再购买哦,电子资源购买后不支持退款哦

   

发表回复

您的电子邮箱地址不会被公开。