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

程序设计师-Ja315道题

1.运行下列程序,会产生()结果。classOuter1{ privateinta; voidfoo(doubled,finalfloatf){Strings;finalbooleanb;classInner{ voidmethodInner(){System.out.println("intheInner"); }} } publicstaticvoidmain(Stringargs[]){Outer1me=newOuter1();me.foo(123,123);System.out.println("outer");} }

单选题

A. intheInnerouter~||~outer~||~intheInner~||~编译不通过

2.下面程序段()行有错误。、abstractclassEmployee{2、intbasic=2;3、abstractvoidsalary();4、}5、classManagerextendsEmployee{6、Employeeemp=newEmployee();7、voidsalary(){8、System.out.println(“工资等于”+basic*5+5678);9、}1、}

单选题

A. 3行~||~6行~||~7行~||~8行

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

多选题

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

4.下面()对象表示标准输入对象流。

单选题

A. System.in~||~System.out~||~System.err~||~System.read

5.给出下面的代码publicclassParent{publicintaddValue(inta,intb){ints;

多选题

A. intaddValue(inta,intb){//dosomething...}~||~publicvoidaddValue(){//dosomething...}~||~publicintaddValue(inta){//dosomething...}~||~publicintaddValue(inta,intb)throwsException{//dosomething...}

6.关于Float,下列说法正确的是()。

多选题

A. Float是一个类~||~Float在java.lang包中~||~Floata=1.0是正确的赋值方法~||~Floata=newFloat(1.0)是正确的赋值方法

7.一个数据库可以包含多个表,一个表中可以包含多个记录。

判断题

8.一个异常处理中finally语句块只能有一个或者可以没有。

判断题

9.main()方法的返回类型是什么?

单选题

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

10.Jbuilder9版中默认的布局管理器是()。

单选题

A. GridLayout~||~BorderLayout~||~CardLayout~||~FlowLayout

11.JDBC提供的主要接口有()。

多选题

A. java.sql.DriverManager~||~java.sql.Connection~||~java.sql.Statement~||~java.sql.ResultSet

12.下列()语句是执行SQL语句时使用的语句。

单选题

A. StatementSQL语句变量=连接变量.createStatement()~||~Connection连接变量=DriverManager.getConnection(数据库URL,用户帐号,用户密码)~||~Class.forName(JDBC驱动程序名)~||~连接变量.close()

13.给出下面代码段: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

14.Applet调用()方法后,进入初始态。

单选题

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

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

判断题

16.System.out.println("lessthan5");7}8else{System.out.println("end");}哪些行将导致错误?

单选题

A. 第1行~||~第2行~||~第5行~||~第8行

17.要画一个左上角顶点是(1,1),右下角顶点是(2,2)的矩形,下面哪个命令是正确的是()。

单选题

A. drawRect(100,100,200,200)~||~drawRect(200,200,100,100)~||~drawRect(100,100,100,100)~||~drawRect(100,100)(200,200)

18.继承性和多态性的结合,可以生成一系列虽类似但独一无二的对象。

判断题

19.以下有关Servlet常用的请求头的含义说法错误的是()。

单选题

A. Accept-Language头指出客户端倾向的语言。如en。~||~Content-Length头以字节为单位给出POST数据的长度。~||~Host表明了主机和端口。~||~User-Agent头表明了发出请求的客户代理的信息

20.下列组件()是Swing窗口容器。

多选题

A. ContentPane~||~JApplet~||~Jdialog~||~Jpanel

注册后查看全部试题

保定市乐凯大街305号

电话: 400-608-5357

邮编: 100043


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

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