java选择题练习附答案(Java multiple-choice exercises with answers).docVIP

  • 9
  • 0
  • 约8.41千字
  • 约 29页
  • 2017-10-07 发布于河南
  • 举报

java选择题练习附答案(Java multiple-choice exercises with answers).doc

java选择题练习附答案(Java multiple-choice exercises with answers)

java选择题练习附答案(Java multiple-choice exercises with answers) Distance education electronic commerce (undergraduate), Zhejiang University JAVA simulation questions Multiple choice questions (choose the correct answer, in five answers to each item in the correct answer and the serial number in the stem behind the brackets, the wrong choice, missed the election did not score. ) 1, the following code: Class Test{ Private int m; Public, static, void, fun () { Some / / code... } } How do you make member variables m accessed directly by the function fun ()? A, change private int m to protected int m B, change private int m to public int m C, change private int m to static int m D, change private, int, m to int m Answer: C 2. Which of the following functions are overloaded functions of public, void, example () {?}? A, public, void, example (int, m) {...} B, public, int, example () {...} C, public, void, example2 () {...} D, public, int, example (int, m, float, f) {{} Answer: A, D 3, give the following code segment: Public class Base{ Int, W, x, y, z; Public Base (int, a, int, b) { X=a; y=b; } Public, Base (int, a, int, B, int, C, int, d) { Assignment / x=a, y=b W=d; Z=c; } } That / / assignment x=a in the code, y=b written as follows which code is correct? A, Base (a, B); B, x=a, y=b; C, x=a; y=b; D, this (a, B); Answer: C, D 4, known as the following definition: String s = story; Which of the following expressions is legal? A, s = books; B, char, C = s[1]; C, int, len = s.length; D, String, t = s.toLowerCase (); Answer: A, D What is the value of the main () function in 5 and Java? A, String B, int C, char D, void Answer: D 6 which of the following strings are identifiers in Java? A, fieldname B, super C, 3number D, #number E, $number Answer: A, E 7. Which of the following are valid keywords in Java? A, const B, NULL C, false D, this E, native Answer: A, C, D, E 8. Which of the following are the correct integer representations of Java? A, 22 B, 0x22 C, 022 D, 22H Answer: A, B,

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档