首页>题库>程序设计师-Java
1.下列()方法可以给当前指针所在位置做一个标记。
单选题A. publicvoidreset()~||~publicvoidmark()~||~publicvoidtag()~||~publicvoidsign()
2.java中定义数组名为abc,下面()可以得到数组元素的个数。
单选题A. abc.length()~||~abc.length~||~len(abc)~||~ubound(abc)
3.动作事件由()得名而来。
单选题A. 在相应其他事情时发生。~||~表示为响应而采取某种动作。~||~组件的方法的另一种称呼~||~由程序员命名
4.关于Servlet的论述,正确的有()。
单选题A. Servlet是一种Java应用程序。~||~Servlet可以通过javaservlet-name直接运行~||~有些Servlet是需要在客户端运行的~||~我们常说的Servlet是继承HttpServlet类的服务器端Java程序
5.给出下面代码段:1)switch(m)2){case、System.out.println("case");3)case1、System.out.println("case1");break;4)case2、5)default、System.out.println("default");6)}下列m的()值将引起"default"的输出。
多选题A. 0~||~1~||~2~||~3
6.break语句可直接跳出外层循环。
判断题7.功能完善的组件模型提供以下()服务。
多选题A. 事件处理~||~分布式计算~||~数据库管理~||~应用程序构造器支持
8.Jbuilder9版中默认的布局管理器是()。
单选题A. GridLayout~||~BorderLayout~||~CardLayout~||~FlowLayout
9.equals()方法与相等操作符(==)具有相同的功能。
判断题10.在声明线程的run方法时,必须使用的限定词是()。
单选题A. public~||~private~||~protected~||~static
11.下列程序的错误有()。finalclassFirst{privateinta=1;intb=2;}classSecondextendsFirst{publicvoidmethod(){System.out.println(a+b);}}
多选题A. println()参数应为字符串,因此此处不能调用该方法~||~因为变量a是private,所以在其他类中不能访问a~||~Second不能继承First。~||~关键字final不能修饰类
12.下面程序段的运行的结果是()。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.
13.纯面向对象的语言有()。
单选题A. C~||~C++~||~Java~||~Pascal
14.JAVA编程中,以下()命令用来执行java类文件。
单选题A. javac~||~java~||~appletviewer~||~以上所有选项都不正确
15.实现接口的关键字是()。
单选题A. extends~||~extend~||~implements~||~implement
16.Servlet是EJB中的一个子集。
判断题17.Java中数组的元素可以是简单数据类型的量,也可以是某一类的对象。
判断题18.给定下面的代码片段:1)Stringstr=null;2)if((str!=null)&&(str.length()〉1)){3)System.out.println("morethan1");4)}5)elseif((str!=null)&(str.length()〈5)){6)System.out.println("lessthan5");7)}8)else{System.out.println("end");}()行会导致错误。
单选题A. line1~||~line2~||~line5~||~line8
19.关于选择结构下列()说法是正确的。
单选题A. if语句和else语句必须成对出现~||~if语句可以没有else语句对应~||~switch结构中每个case语句中必须用break语句~||~switch结构中必须有default语句
20.System.out.println("lessthan5");7}8else{System.out.println("end");}哪些行将导致错误?
单选题A. 第1行~||~第2行~||~第5行~||~第8行
Copyright © 昊元综合学习与考试平台 保定昊元电气科技有限公司版权所有 2021,All Rights Reserved
经营许可证编号: 冀B2-20210069号 备案号: 冀ICP备19021638号