还剩13页未读,继续阅读
本资源只提供10页预览,全部文档请下载后查看!喜欢就下载吧,查找使用更方便
文本内容:
班级学号姓名:笔试题Java(可多选).下面哪些是类的措施1Thread ABDA startB runC exitD getPriorityO.下面有关类勺说法对日勺日勺是()2B A继承自A ThrowableBSerialable该类实现了接口C Throwable该类是一种公共类D下面程序勺运行成果是
3.B falseString strl=hello;String str2=he+new StringCllo;System.err.printlnstrl==str2;.下列说法对日勺日勺有()4Cpublic voidchangeString str,char ch[]{str=test ok;ch
[0]=g;、A goodand abc、B goodand gbc、C testok andabc、D testok andgbc要从文献中读出第个字节到变量中,下列哪个措
25.file.dat10c施适合?AB,,1A FilelnputStreamin=new FileInputStream file.dat;in.skip9;int c=in.read;,,nB FilelnputStreamin=new FileInputStreamfile.dat;in.skiplO;int c=in.read;二,,,,C FilelnputStreamin newFileInputStreamfile.dat;intc=in.read;n nDRandomAccessFile in=new RandomAccessFilefile.dat;in.skip9;int c=in.readByte;下列哪种异常是检查型异常,需要在编写程序时申明
26.CA NullPointerExceptionBClassCastExceptionC FileNotFoundExceptionDIndexOutOfBoundsException下面日勺措施,当输入为勺时候返回值是多少?
27.2H Dpublicstatic intgetValueint i{int result=0;switch i{case1:result=result+i;case2:result=result+i*2;case3:result=result+i*3;return result;}AO B2C4D10也需要Switch Break选项中哪一行代码可以替代题目中〃而不产生编
28.add codehere译错误?A publicabstract classMyClass{public intconstlnt=5;//add codehere public void method{}A publicabstract voidmethodint a;B constlnt=constlnt+5;C publicint method;D publicabstract voidanotherMethodQ{}阅读和两个类日勺定义在序列化一种勺
29.Shape CircleCircle B对象到文献时,下面哪个字段会被保留到文献中?circle BclassShape{public String name;class Circleextends Shapeimplements Serializable{private floatradius;transient intcolor;public staticString type=Circle;A nameBradiusC colorDtype父类为继承接口,其组员不能被序列化,静态变量和Serializable修饰日勺不能被序列化transient下面是和类曰勺定义和构造措施,每个构造措施都
30.People Child输出编号在执行的时候均有哪些构造措施被次new Childmike序调用?请选择输出成果D classPeople{Stringname;public PeopleQ{System.out.printl;public PeopleStringname{System.out.print2;this.name=name;class Childextends People{People father;public ChildStringname{System.out.print3;this.name=name;H nfather=new Peoplename+:F;public Child{System.out.print4;A312B32C432D132中日勺不可省略A.class constructor必须与同名,但措施不能与同名B.constructor classclass在一种对象被时执行C.constructor new.一种只能定义一种D classconstructor.指针在任何状况下都可进行,,=,===运算?5true下面程序日勺运行成果
6.B public static void mainString args[]{Thread t=new Thread{publicvoidrun{pong;;t.run;System,out.print,pingstatic voidpong{System.out.printpong;A pingpongBpongping和均有也许C pingpongpongping都不输出D下列属于关系型数据库的是()
7.ABA.Oracle BMySql CIMS DMongoDB(垃圾回收器)线程与否为守护线程()
8.GC true(关键字与否能保证线程安全?)
9.volatile false下列说法对日勺的是()
10.AC继承自A LinkedLi stList继承自B AbstractSetSet继承自C HashSetAbstractSet继承自D WeakMapHashMap?存在使日勺数吗(存在)
11.i+1i(勺数据类型是)
12.
0.63326BA floatB doubleC FloatD Double下面哪个流类属于面向字符日勺输入流()
13.AA BufferedWriterBFilelnputStreamC ObjectinputstreamDInputStreamReader接口日勺修饰符可认为()
14.Java CDAprivate Bprotected Cfinal Dabstract不通过构造函数也能创立对象吗()
15.A是否A BAOB1C2D3()中勺扩充几次()
16.ArrayList list=new ArrayList20;H listA下面哪些是对称加密算法
17.AB ADES BAES CDSA DRSA.新建一种流对象,下面哪个选项的代码是错误勺18B BAnew BufferedWriternewFileWritera.txt;Bnew BufferedReadernewFilelnputStreamCa.dat;Cnew GZIPOutputStreamnewFileOutputStreama.zip;,,,,Dnew ObjectInputStreamnewFileInputStream a.dat;下面程序能正常运行吗
19.yes public class NULL{public staticvoid haha{;System.out.println”haha”}public staticvoid mainString[]args{NULLnull.haha;下面程序勺运行成果是什么
20.Bclass HelloA{public HelloA{System.out.println HelloA;{System.out.printlnCTm Aclass;}static{System.out.printlnstatic A;}}public classHelloB extendsHelloA{public HelloB{System.out.println HelloB;}{System.out.printlnrm Bclass;}public staticvoid mainString[]args{new HelloB;Static AStaticBHello AFm AclassHelp BFm BClass措施如下,中可以捕捉三种类型勺异
21.getCustomerInfo tryB常,假如在该措施运行中产生了一种将会输出什么lOException,成果Apublic voidgetCustomerInfo{try//do somethingthat maycause anException}catch java.io.FileNotFoundException ex{System.out.printFileNotFoundException!;}catch java.io.IOException ex{;System.out.print”IOException!”}catch java.lang.Exception ex{,,System.outprint Exception!;}A lOException!B lOExceptionlException!C FileNotFoundException!IOException!D FileNotFoundException!IOException!Exception!下面代码日勺运行成果为
22.C import java.io/;importjava.util.*;publicclassfoo{public staticvoidmainString[]args{String s;〃代码得到编译,并输出二〃A s代码得到编译,并输出二B snull由于没有初始化,代码不能编译通过C Strings代码得到编译,但捕捉到异常D NullPointException的输出成果应当是
23.System.out.println5+2;AA52B7C2D
5.指出下列程序运行的成果24J Bpublicclass Example{,,,,String str=new Stringgood;char[]ch={a,b,c;publicstaticvoid mainStringargs[]{Example ex=new Example;ex.changeex.str ex.ch;zSystem.out.printex.str+”and;。
个人认证
优秀文档
获得点赞 0