(java单选题.docVIP

  • 61
  • 0
  • 约4.01万字
  • 约 35页
  • 2017-01-21 发布于北京
  • 举报
(java单选题

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位有符号整数 int:32位有符号整数 long:64(8字节)位有符号整数 float:32位单精度浮点数 double:64位单精度浮点数 char:单个字符,使用16位Unicode编码 boolean 2. ?The two Boolean literals available in Java are _____ and _____.????????? (d) ?(a) T, F ?(b) 0, 1 ?(c) TRUE, FALSE ?(d) true, false? 3. ?Consider the following line of Java code.??????? (c) ? int x = 1+7*2; ? What will be the value of x at the end of execution of the line of code? ?(a) 21 ?(b) 16 ?(c) 15 ?(d) 9? 4. ?How many lines of output will be produced by the following code fragment????? (d) ?for (int? i = 0; i 4; ++i)? { ??? for (int? j = 1;? j 3 ; ++j)? { ??????? stdOut.println(i + j); ?(a) 10 ?(b) 12 ?(c) 6 ?(d) 8? ?? 5. ?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 comment should be????? (c) ?(a) an @author tag ?(b) the order of lines is not important ?(c) a summary sentence of the declared entry ?(d) an @version tag?? 7. ?The coding system used to represent characters in Java is???? (c) ?(a) bytecode ?(b) ASCII ?(c) Unicode ?(d) EBCDIC? 8. ?Which expression below evaluates to true if and only if x is in the range [0, 9] (inclusive)???? (a) ?(a) !(x 0 || x 9) ?(b) 0 x 9 ?(c) 0 = x = 9 ?(d) x 0 x 9? 9. ?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) a ?(d) = 1. ????Which of 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 u

文档评论(0)

1亿VIP精品文档

相关文档