java单选题2018年版.docx
《java单选题2018年版.docx》由会员分享,可在线阅读,更多相关《java单选题2018年版.docx(44页珍藏版)》请在第一文库网上搜索。
1、1. How many bytes of storage are required for an integer of type long in Java? (b)(a) Four(b) Eight(c) Two(d) Three注 java中有8种基本类型byte:8位无符号整数 short: 16位有符号整数臧廷杰int32位有符号整数long:64(8字节)位有符号整数float:32位单精度浮点数double:64位单精度浮点数char:单个字符 使用16位Unicode编码 boolean2.The two Boolean literals avallable in Java are
2、 and.(d)(a) T, F(b) 0, 1(c) TRUE, FALSE(d) true, false3.Consider the following line of Java code.(c)int x = 1+7*2;What wi11 be the value of x at the end of execution of the line of code?(a) 21(b) 16(c) 15(d) 94.How many lines of output will be produced by the following code fragment?(d)for (int i =
3、0; i 4; +i) for (int j = 1; j 3 ; +j)stdOut. println(i + j);(a) 10(b) 12(c) 6(d) 85.Which is the Java keyword used to denote a class method? (d)(a) class(b) private(c) final(d) static 6? According to Javadoc convention, the first sentence of each Javadoc commentshould be (c)(a) an author tag(b) the
4、order of lines is not important(c) a summary sentence of the declared entry(d) an version tag7.The coding system used to represent characters in Java is (c)(a) bytecode(b) ASCII(c) Unicode(d) EBCDIC8.Which expression below evaluates to true if and only if x is in the range 0,9 (inclusive)? (a)(a) !
5、(x 9)(b) 0 x 9(c) 0 = 9(d) x 0 & x 99.Which of the following is a valid integer constant declaration? (a)(a) final int SCALE = 10;(b) int final SCALE = 10;(c) final SCALE = 10;(d) int SCALE = 10;10.Which of the following is a valid character literal in Java?(注意字符与字符串的表示)(a)(a),(b) (c) /(d)11.Which o
6、f the following is not equivalent in value to the following expression? (b)flag = false(a) flag != true(b) flag(c) !flag(d) ! (flag = true)臧廷杰12. Which of the following statements is used to exit from a switch statement?(a)(a) break;(b) end;(c) exit;(d) default;13.Which of the following is not a leg
7、al identifier in Java? (c)(a) firstindex(b) $first index(c) 1 index(d) indexl14.Tn Java, what is the identifier for the primitive type used to represent a character? (b)(a) Character(b) char(c) character(d) Char15.Which of the following is a valid literal of type float in Java?(c)(a) 10. 5sp(b) 10.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 选题 2018 年版 doc