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

程序设计师-Ja315道题

1.Java的输入输出是以()方式处理的。

单选题

A. 文件~||~流~||~块~||~接口

2.Servlet是EJB中的一个子集。

判断题

3.SQL语句如下:UPDATEchenjiSETname=’andy’,age=28,gender=’M’WHEREID=’16’它完成的功能是()。

单选题

A. 将name=’andy’的记录ID值改为16~||~将age=28的记录ID值改为16~||~将name=’andy’且age=28、gender=’M’的记录的ID值改为16~||~将ID=16的记录name值改为andy、age值改为28、gender值改为M

4.给出下面的类publicclassSample{longlength;publicSample(longl){length=l;}publicstaticvoidmain(Stringarg[]){Samples1,s2,s3;s1=newSample(21L);s2=newSample(21L);s3=s2;longm=21L;}}哪个表达式返回true?

单选题

A. s1==s2;~||~s2==s3;~||~m==s1;~||~s1.equals(m);

5.File类的length()方法可以获取文件长度,其返回值是()。

单选题

A. 文件的行数~||~文件的位数~||~文件的块数~||~文件的字节数

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

单选题

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

7.数组中可以包含()类型的元素。

单选题

A. int型~||~string型~||~数组~||~以上都可以

8.下面程序段的运行的结果是()。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.

9.JavaBean主要指组件的开发,()用于图形界面。

单选题

A. 可以~||~不可以~||~因系统不同而不同~||~不知道

10.当Frame改变大小时,放在其中的按钮大小不变,则使用如下()layout。

单选题

A. GridLayout~||~CardLayout~||~EastandWestofBorderLayout~||~FlowLayout

11.定义一个方法时可加上的修饰词有()。

多选题

A. public~||~static~||~final~||~default

12.下面语句段的输出结果是()。inti=9;switch(i){default、System.out.println("default");case、ystem.out.println("zero");break;case1、System.out.println("one");case2、System.out.println("two");}

单选题

A. default~||~default,zero~||~errordefaultclausenotdefined~||~nooutputdisplayed

13.java中定义数组名为abc,下面()可以得到数组元素的个数。

单选题

A. abc.length()~||~abc.length~||~len(abc)~||~ubound(abc)

14.关于以下程序代码的说明正确的是()。.classHasStatic{2.privatestaticintx=1;3.publicstaticvoidmain(Stringargs[]){4.HasStatichs1=newHasStatic();5.hs1.x++;6.HasStatichs2=newHasStatic();7.hs2.x++;8.hs1=newHasStatic();9.hs1.x++;1.HasStatic.x--;11.System.out.println(“x=”+x);12.}13.}

单选题

A. 5行不能通过编译,因为引用了私有静态变量~||~10行不能通过编译,因为x是私有静态变量~||~程序通过编译,输出结果为:x=103~||~程序通过编译,输出结果为:x=102

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

单选题

A. 类、对象、接口、包。~||~抽象性、封装性、继承性和多态性~||~对象、事件、消息。~||~以上都不是。

16.下列()情况可以终止当前线程的运行。

多选题

A. 抛出一个例外时~||~当该线程调用sleep()方法时~||~当创建一个新线程时~||~当一个优先级高的线程进入就绪状态时

17.下面()赋值语句是错误的。

多选题

A. floatf=11.1;~||~doubled=5.3E12;~||~charc=“ ”;~||~bytebb=433;

18.实现接口的关键字是()。

单选题

A. extends~||~extend~||~implements~||~implement

19.建立了SQL语句变量,便可以执行SQL语句。如要执行查询数据的SELECT语句,可以通过()语句来实现。

单选题

A. executeQuery()~||~executeUpdate()~||~execute()~||~createStatement()

20.用publicintread()定义read()方法时,如果输入流的当前位置没有数据,则返回()。

单选题

A. 0~||~-1~||~NULL~||~ERROR

注册后查看全部试题

保定市乐凯大街305号

电话: 400-608-5357

邮编: 100043


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

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