首页>题库>程序设计师-Java

程序设计师-Ja315道题

1.Java的输入输出流可以分为()。

单选题

A. 位流和文件流~||~位流和字节流~||~位流和字符流~||~文件流和字符流

2.面向对象技术的基本要素主要有()。

多选题

A. 抽象性~||~封装性~||~继承性~||~多态性

3.下面程序段的运行的结果是()。classExample{publicstaticvoidmain(String[]args){Stringstr1=newString(“abc”);Stringstr2=newString(“abc”);if(str1.equals(str2))System.out.println(“Twostringsareequal.”);elseSystem.out.println(“Twostringsarenotequal.”);if(str1==str2)System.out.println(“str1==str2istrue.”);elseSystem.out.println(“str1==str2isfalse.”);}}

单选题

A. Twostringsareequal.str1==str2isfalse.~||~Twostringsarenotequal.str1==str2isfalse.~||~Twostringsareequal.str1==str2istrue.~||~Twostringsarenotequal.str1==str2istrue.

4.java语言中不用区分字母的大写小写。

判断题

5.对于下列代码:1)classPerson{2)publicvoidprintValue(inti,intj){//...}3)publicvoidprintValue(inti){//...}4)}5)publicclassTeacherextendsPerson{6)publicvoidprintValue(){//...}7)publicvoidprintValue(inti){//...}8)publicstaticvoidmain(Stringargs[]){9)Persont=newTeacher();1)t.printValue(1);11)}第1行语句将调用()语句。

单选题

A. line2~||~line3~||~line6~||~line7

6.通过设置线程优先级可以使某些线程获得更多的CPU处理时间。

判断题

7.下列()说法正确。

单选题

A. 子类可以对超类方法覆盖或方法重载~||~子类只能重载父类的方法,而不能覆盖~||~子类不能定义和父类同名同形参的方法,否则,系统将不知道使用哪个方法~||~重载就是一个类中有多个同名但有不同形参和方法体的方法

8.下列程序存在的错误有()。finalclassFirst{privateinta=1;intb=2;}classSecondextendsFirst{publicvoidmethod(){System.out.println(a+b);}}

多选题

A. println()参数应为字符串,因此此处不能调用该方法。~||~因为变量a是private,所以在其他类中不能到访问a。~||~Second不能继承First。~||~关键字final不能修饰类。

9.如果关闭一个Applet程序,下面()方法会被调用。

多选题

A. start()~||~paint()~||~stop()~||~destroy()

10.下面的哪些程序片断可能导致错误。

多选题

A. Strings="Gonewiththewind";~||~Strings="Gonewiththewind";~||~Strings="Gonewiththewind";~||~Strings="homedirectory";

11.在声明线程的run方法时,必须使用的限定词是()。

单选题

A. public~||~private~||~protected~||~static

12.在Windows2下使用Access数据库,必须使用JDBC-ODBC桥接程序。

判断题

13.临界区指出它只能同时被一个线程访问,并且可以指定由线程访问的优先顺序。

判断题

14.如果下列的方法能够正常运行,在控制台上将显示()。publicvoidexample(){try{unsafe();System.out.println("Test1");}catch(SafeExceptione){System.out.println("Test2");}finally{System.out.println("Test3");}System.out.println("Test4");}

多选题

A. Test1~||~Test2~||~Test3~||~Test4

15.Applet小程序编写时,后缀名应为()。

单选题

A. .java~||~.jsp~||~.applet~||~.html

16.主动产生一个异常而非动态抛出的是()。

单选题

A. throw语句~||~throws语句~||~try…catch语句~||~finally语句

17.下列选项中,属于Java语言的关键字的是()。

多选题

A. goto~||~malloc~||~extends~||~假

18.Main()方法的返回类型是()。

单选题

A. int~||~void~||~boolean~||~static

19.第十行的声明将调用哪些方法1classPerson{2publicvoidprintValue(inti,intj){/*…*/}3publicvoidprintValue(inti){/*...*/}4}5publicclassTeacherextendsPerson{6publicvoidprintValue(){/*...*/}7publicvoidprintValue(inti){/*...*/}

判断题

20.Applet与Application的区别有()。

多选题

A. Application是从其中的main()方法开始运行的。~||~运行Applet必须创建一个浏览器文件,如HTML。~||~Applet载入浏览器后必须指定何时运行。~||~浏览器通过main()方法指定Applet何时执行。

注册后查看全部试题

保定市乐凯大街305号

电话: 400-608-5357

邮编: 100043


Copyright © 昊元综合学习与考试平台 保定昊元电气科技有限公司版权所有 2021,All Rights Reserved

经营许可证编号:  冀B2-20210069号       备案号:    冀ICP备19021638号