《Java程序设计实用教程实验指导、实训与习题解析》 《Java语言程序设计》模拟试卷A.docx
《《Java程序设计实用教程实验指导、实训与习题解析》 《Java语言程序设计》模拟试卷A.docx》由会员分享,可在线阅读,更多相关《《Java程序设计实用教程实验指导、实训与习题解析》 《Java语言程序设计》模拟试卷A.docx(5页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 Oava语言程序设计模拟试卷A(考试时间90分钟 总分100分)一、选择题(每题2.5分,共50分)1. Which of the following range of short is correct?A,-27- 27-lB.0-216-1C. 215-215-lD. 231 - 23I-12. Which declarations of identifiers are legal?A. $personsTwoUsers*pointthisB. _endline3. Which statement of assigning a long type variable to a hexade
2、cimal value is correct?A. long number = 345L;long number = 0345;long number = 0345L;long number = 0x345L4. Which of the following fragments might cause errors?A. String s = Gone with the wind*;String t = good ”;String k = s + t;String s = Gone with the wind1;String t;t = s3 + one”;String s = Gone wi
3、th the wind*;String standard = s.toUpperCase();B. String s = nhome directory*;String t = s - directory;5. Which are syntactically valid statement at/ point x?class Person private int a;public int change(int m) return m; )public class Teacher extends Person public int b;public static void main(String
4、 arg )Person p = new Person();Teacher t = new Teacher();int i;/ point x)A. i = m;B. i = b;C. i = p.a;D. i = p.change(30);E. i = t.b.6. Given the following code fragment:1) public void create() 2) Vector myVect;3) myVect = new Vector();4)Which of the following statements are true?A. The declaration o
5、n line 2 does not allocate memory space for the variable myVect.B. The declaration on line 2 allocates memory space for a reference to a Vector object.C. The statement on line 2 creates an object of class Vector.D. The statement on line 3 creates an object of class Vector.E. The statement on line 3
6、allocates memory space for an object of class VectorWhich are not Java keywords?A. TRUEB. sizeofC. constD.superE. voidWhich of the following statements are true?A. The equals() method determines if reference values refer to the same object.B. The = operator determines if the contents and type of two
7、 separate objects match.C. The equals() method returns true only when the contents of two objects match.D. The class File overrides equals() to return true if the contents and type of two separate objects match.7. Which statements about inheritance are true?A. In Java programming language only allow
8、s single inheritance.B. In Java programming language allows a class to implement only one interface.C. In Java programming language a class cannot extend a class and implement a interface together.D. In Java programming language single inheritance makes code more reliable.8.1) class Person 2) public
9、 void printValue(int i, int j) /*/ 3) public void printValue(int i)/*.*/ 4)5) public class Teacher extends Person 6) public void printValue。/*.*/ )7) public void printValue(int i) /*.*/8) public static void main(String args )9) Person t = new Teacher();10) t.printValue(lO);11)12)Which method will th
10、e statement on line 10 call?11) on line 212) on line 313) on line 614) on line 7Which are not Java primitive types?A. shortB. BooleanC. unitD. floatWhich keyword should be used to enable interaction with the lock of an object? The flag allows exclusive access to that object.A. transientB. synchroniz
11、edC. serializeD. staticWhich is the return type of the method main()?A. intB. voidC. booleanD. staticGiven the following code:if (x0) System.out.println(nfirstn); else if (x-3) System.out.println(Hsecondn); else System.out.println(nthirdn); Which range of x value would print the string second”?A. x
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Java程序设计实用教程实验指导、实训与习题解析 Java语言程序设计 Java程序设计实用教程实验指导、实训与
链接地址:https://www.taowenge.com/p-69336757.html
限制150内