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

程序设计师-Ja315道题

1.下面()注释方法能够支持javadoc命令。

单选题

A. /**...**/~||~/*...*/~||~//~||~/**...*/

2.下列代码段允许按钮注册一个action事件的是()。

单选题

A. button.enableActionEvents();~||~button.addActionListener(anActionListener);~||~button.enableEvents(true);~||~button.enableEvents(AWTEvent.ACTION_EVENT_MASK);

3.以下语句中有语法错误的是()。

单选题

A. for(;;);~||~for(intI=0;I〈100;I++〉〔〕;~||~if(a〈0〉a++;~||~;;;

4.创建字符串s:Strings=newString(“hello”);下面()语句将改变s。

单选题

A. s.append(“aaa”);~||~s.concat(s);~||~s.substring(3)~||~以上语句都不会

5.Java程序是由若干个类组成。

判断题

6.以下声明合法的是()。

单选题

A. defaultStrings;~||~publicfinalstaticintw()~||~abstractdoubled;~||~abstractfinaldoublehyperbolicCosine()

7.Java程序中最小的可编译的单元为()。

单选题

A. 对象~||~类~||~方法~||~语句

8.Applet执行()方法后,进入运行态。

单选题

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

9.下面程序段()行有错误。、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行

10.如果目前图形界面中的布局是BorderLayout,需要使新加入的组件位于图形界面的下部,应该调整()属性的值。

单选题

A. alignmentx~||~alignmenty~||~constraints~||~以上都不是

11.接口中可以存在已实现的方法

判断题

12.给出下面的不完整的类代码classPerson{Stringname,department;intage;publicPerson(Stringn){name=n;}publicPerson(Stringn,inta){name=n;age=a;}publicPerson(Stringn,Stringd,inta){//完成Person(Stringn,inta)的逻辑

单选题

A. Person(n,a);~||~this(Person(n,a));~||~this(n,a);~||~this(name,age);

13.已知如下说明:TextAreata=newTextArea("Hello",5,5),请问()语句是正确的。

多选题

A. Themaximumnumberofcharactersinalineis5.~||~Thedisplayedheightis5linesotherwiseconstrain.~||~Thedisplayedstringcanusemultiplefonts.~||~Thedisplayedstringsareeditable.

14.面向对象的的方法与面向过程的方法最大的不同在于()。

单选题

A. 以功能为中心~||~以数据为中心~||~以功能和数据为中心~||~以事件驱动为中心

15.给出下面的类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);

16.静态页面和动态页面的区别在于()。

单选题

A. 动态页面能够有动画,静态没有~||~动态页面能够根据不同用户产生不同的响应,静态的不行~||~动态页面是经常在改变的,静态的常年不变~||~动态页面能够接收用户输入,并在服务器端作处理,静态的不行

17.常用的服务器脚本语言是()。

单选题

A. Java,CGI,~||~Applet,Asp,PHP~||~JSP,ColdFusion,ASP~||~以上都是

18.Java为处理管道提供了()类。

多选题

A. PipeInputStream~||~PipedInputStream~||~PipeOutputStream~||~PipedOutputStream

19.最终类不能派生子类,最终方法不能被覆盖。

判断题

20.关于以下程序代码的说明正确的是()。.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

注册后查看全部试题

保定市乐凯大街305号

电话: 400-608-5357

邮编: 100043


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

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