首页>题库>程序设计师-Java
1.执行下列代码后,()结论是正确的。String[]s=newString[15];
多选题A. s[15]为"";~||~s[14]为null;~||~s[0]为未定义~||~s.length为15
2.下面()类是以字符方式从流中读入数据。
单选题A. Reader~||~Writer~||~Scaner~||~Printer
3.下列类定义中()是合法的抽象类定义。
多选题A. abstractA{abstractvoidfun1();}~||~abstractclassA{abstractvoidfun1();}~||~abstractclassA{abstractvoidfun1(){};}~||~abstractclassA{voidfun1(){};}
4.下面()语句能够正确地生成空字符串。
多选题A. Stringa[]=newString[5];for(inti=0;i〈5;a[++]="");~||~Stringa[5];~||~String[5]a;~||~Stringa[]={"","","","",""};
5.给出下面的代码publicclassParent{publicintaddValue(inta,intb){ints;
多选题A. intaddValue(inta,intb){//dosomething...}~||~publicvoidaddValue(){//dosomething...}~||~publicintaddValue(inta){//dosomething...}~||~publicintaddValue(inta,intb)throwsException{//dosomething...}
6.对成员的访问控制保护最强的是()。
单选题A. public~||~缺省~||~private~||~protected
7.关于继承的说法正确的是()。
单选题A. 子类将继承父类所有的属性和方法~||~子类继承父类的非私有属性和方法~||~子类只继承父类public方法和属性~||~子类只继承父类的方法,而不继承属性
8.运行下列程序,会产生()结果。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~||~编译不通过
9.关于notify与notifyAll方法,以下说法正确的是()。
单选题A. notifyAll方法唤醒所有阻塞的线程~||~notify方法唤醒正在等待这个锁的所有线程正在等待的线程~||~notify方法只唤醒一个被阻塞的线程~||~notifyAll方法唤醒正在等待这个锁的所有线程正在等待的线程
10.纯面向对象的语言有()。
单选题A. C~||~C++~||~Java~||~Pascal
11.sleep(1)表示调用此方法后可以使线程睡眠()秒。
单选题A. 10000秒~||~100秒~||~10秒~||~10000分钟
12.第十行的声明将调用哪些方法1classPerson{2publicvoidprintValue(inti,intj){/*…*/}3publicvoidprintValue(inti){/*...*/}4}5publicclassTeacherextendsPerson{6publicvoidprintValue(){/*...*/}7publicvoidprintValue(inti){/*...*/}
判断题13.下列选项中,属于Java语言的关键字的是()。
多选题A. goto~||~malloc~||~extends~||~假
14.如果关闭一个Applet程序,下面()方法会被调用。
多选题A. start()~||~paint()~||~stop()~||~destroy()
15.类与对象的关系是()。
多选题A. 类是对象集合的再抽象。~||~类(Class)是具有相同属性和行为的一组对象的集合。~||~一个对象称作类的一个实例。~||~类与对象是父与子的关系。
16.要想建立一个学生成绩表student,以下()SQL语句是正确的。
单选题A. createtablestudent~||~createtablestudent(学号char(10),姓名char(8))~||~creategridstudent~||~creategridstudent(学号char(10),姓名char(8))
17.Jsp支持隐藏注释,这种注释写在Jsp程序中,但并不会发给客户端。
判断题18.关于以下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
19.以下语句中有语法错误的是()。
单选题A. for(;;);~||~for(intI=0;I〈100;I++〉〔〕;~||~if(a〈0〉a++;~||~;;;
20.下列()方法可以给当前指针所在位置做一个标记。
单选题A. publicvoidreset()~||~publicvoidmark()~||~publicvoidtag()~||~publicvoidsign()
Copyright © 昊元综合学习与考试平台 保定昊元电气科技有限公司版权所有 2021,All Rights Reserved
经营许可证编号: 冀B2-20210069号 备案号: 冀ICP备19021638号