首页>题库>程序设计师-Java
1.属于面向对象的语言有()。
多选题A. C~||~Pascal~||~Java~||~C++
2.下面()事件监听器在Java中有事件适配器。
多选题A. MouseListener~||~KeyListener~||~ActionListener~||~ItemListener
3.下列运算结果默认为float的是()。
单选题A. 100/10~||~100*10~||~100F+10~||~100D-10
4.Java和C++都是纯面向对象的语言。
判断题5.以下有关面向对象设计方法错误的是()。
单选题A. 提高程序的可复用性。~||~增加可扩展性。~||~改善程序的可维护性。~||~很难控制程序的复杂性。
6.菜单的快捷方式是计算机自动分配的。
判断题7.接口中可以存在已实现的方法
判断题8.可以通过在线程组上调用()方法将所有线程入进一个数组。
单选题A. group~||~collect~||~enumerate~||~enter
9.关于以下application的说明,正确的是()。.classStaticStuff2.{3.staticintx=1;4.static{x+=5;}5.publicstaticvoidmain(Stringargs[])6.{7.System.out.println(“x=”+x);8.}9.static{x/=3;}1.}
单选题A. 4行与9行不能通过编译,因为缺少方法名和返回类型~||~9行不能通过编译,因为只能有一个静态初始化器~||~编译通过,执行结果为:x=5~||~编译通过,执行结果为:x=3
10.classParent{2)privateStringname;3)publicParent(){}4)}5)publicclassChildextendsParent{6)privateStringdepartment;7)publicChild(){}8)publicStringgetValue(){returnname;}9)publicvoidmain(Stringarg[]){1)Parentp=newParent();11)}12)}()行将引起错误。
单选题A. 第3行~||~第6行~||~第8行~||~第9行
11.System类的所有属性和方法都是静态的。
判断题12.关于以下程序段的说法,正确的是()。.classMyListenerimplements2.ActionListener,ItemListener{3.publicvoidactionPerformed(ActionEventae){4.System.out.println("Action");}5.publicvoiditemStateChanged(ItemEventie){6.System.out.println("Item");7.}8.}
单选题A. 可通过编译~||~第2行产生编译错误~||~第3行产生编译错误~||~第5行产生编译错误
13.类Test1定义如下:1.publicclassTest1{2.publicfloataMethod(floata,floatb){}3.4.}将以下()方法插入行3是不合法的。
单选题A. publicfloataMethod(floata,floatb,floatc){}~||~publicfloataMethod(floatc,floatd){}~||~publicintaMethod(inta,intb){}~||~privatefloataMethod(inta,intb,intc){}
14.接口名可以作为方法返回值的类型。
判断题15.一个进程内的基本调度单位称为()。
单选题A. 作业~||~信元~||~进程上下文~||~线程
16.一个异常处理中finally语句块只能有一个或者可以没有。
判断题17.下列()语句是加载JDBC驱动程序的语句。
单选题A. StatementSQL语句变量=连接变量.createStatement()~||~Connection连接变量=DriverManager.getConnection(数据库URL,用户帐号,用户密码)~||~Class.forName(JDBC驱动程序名)~||~连接变量.close()
18.已知如下说明:TextAreata=newTextArea("Hello",5,5),请问()语句是正确的。
多选题A. Themaximumnumberofcharactersinalineis5.~||~Thedisplayedheightis5linesotherwiseconstrain.~||~Thedisplayedstringcanusemultiplefonts.~||~Thedisplayedstringsareeditable.
19.下面程序段的运行的结果是()。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.
20.下面()接口是JavaBean必须实现的。
单选题A. java.lang.Runnable~||~java.io.Serializable~||~java.lang.Clonable~||~java.beans.BeanInfo
Copyright © 昊元综合学习与考试平台 保定昊元电气科技有限公司版权所有 2021,All Rights Reserved
经营许可证编号: 冀B2-20210069号 备案号: 冀ICP备19021638号