ImageVerifierCode 换一换
格式:DOCX , 页数:77 ,大小:35.35KB ,
资源ID:14985896      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-14985896.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(精编JAVASE综合测试版题库188题含参考答案.docx)为本站会员(b****1)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

精编JAVASE综合测试版题库188题含参考答案.docx

1、精编JAVASE综合测试版题库188题含参考答案2020年JAVASE综合考试试题库188题含答案一、选择题1创建一个只能存放String的泛型ArrayList的语句是哪项?答案:BA.ArrayList al = new ArrayList();B.ArrayList al = new ArrayList();C.ArrayList al = new ArrayList();D.ArrayList al = new List();2以下代码的输出结果是什么?选择所有的正确答案。class Example public static void main(String args) throws

2、 IOException for (int i = 0; i 10; i+) try try if (i % 3 = 0) throw new Exception(E0); System.out.println(i);break; catch (Exception inner) i *= 2; if (i % 3 = 0) throw new Exception(E1); finally +i; catch (Exception outer) i += 3; finally -i; 答案:A.4B.5C.6D.73以下哪个方法是Math类中定义的?答案:A.absolute()B.log()C

3、.cosine()D.sine()4以下哪个方法用于计算平方根?答案:BA.squareRoot()B.sqrt()C.root()D.sqr()5调用Math.random()方法最有可能输出以下哪些结果?答案:DA.-0.12和0.56E3B.0.12和1.1E1C.-23.45和0.0D.0.356和0.036以下代码的输出结果是什么?public class Example public static void main(String args) System.out.println(Math.round(Float.MAX_VALUE); 答案:BA.输出Integer.MAX_VA

4、LUEB.输出一个最接近Float.MAX_VALUE的整数C.编译失败D.运行时输出异常信息7以下代码的运行结果是什么?public class Example public static void main(String args) double d1 = -0.5; System.out.println(Ceil d1= + Math.ceil(d1); System.out.println(Floor d1= + Math.floor(d1); 答案:BA.输出Ceil d1=-0.0 Floor d1=-1.0B.输出Ceil d1=0.0 Floor d1=-1.0C.输出Ceil

5、 d1=-0.0 Floor d1=-0.0D.输出Ceil d1=0.0 Floor d1=0.08给出以下代码,请问在程序的第6行插入那条语句,改程序可依次打印输出11、10、9?1.public class Example 2. public static void main(String args) 3. double x = 10.2, 9.1, 8.7 ;4. int i = new int3;5. for (int a = 0; a x.length; a+) 6.7. System.out.println(ia);8. 9. 10.答案:CA.i1 = (int)Math.mi

6、n(xa);B.i1 = (int)Math.max(xa);C.i1 = (int)Math.ceil(xa);D.i1 = (int)Math.floor(xa);9以下代码执行结果是?public class Example public static void main(String args) System.out.println(Math.min(Float.NaN, Float.POSITIVE_INFINITY); 答案:AA.输出NaNB.打印输出InfinityC.运行时异常,因为NaN不是有效的参数D.运行时异常,因为Infinity不是有效的参数10下列哪些项是泛型的优

7、点?答案:AA.不用向下强制类型转换B.代码容易编写C.类型安全D.运行速度快11现有int x = reader.read(),下列哪一项正确?答案:A.reader不是FileReader或者BufferedReader类型B.reader可以使FileReader或者BufferedReaderC.reader可以使FileReader类型,但不能使BufferedReader类型D.reader可以使BufferedReader类型,但不能使FileReader类型12List接口的特点是哪项?答案:CA.不允许重复元素,元素有顺序B.允许重复元素,元素无顺序C.允许重复元素,元素有顺

8、序D.不允许重复元素,元素无顺序13以下代码执行结果是什么?class Example public static String output = ; public static void foo(int i) try if (i = 1) throw new Exception(); output += 1; catch (Exception e) output += 2; return; finally output += 3; output += 4; public static void main(String args) throws IOException foo(0); foo(

9、1); System.out.println(output); 答案:A.无内容输出B.代码编译失败C.输出13423D.输出1432314下列代码执行后的输出是哪项?public class Example public static void main(String args) List al = new ArrayList(); al.add(1); al.add(2); al.add(2); al.add(3); System.out.println(al); 答案:A.1,2,3B.1,2,3,3C.1,2,2,3D.2,1,3,215以下代码的执行结果是?public class

10、Example public static void main(String args) TreeSet t = new TreeSet(); if (t.add(one) if (t.add(two) if (t.add(three) t.add(four); for (String s : t) System.out.print(s); 答案:DA.oneB.onethreetwoC.onetwothreefourD.fouronethreetwo16现有:public class Example public static void main(String args) TreeSet s

11、 = new TreeSet(); s.add(one); s.add(two); / 插入代码处 for (String s2 : sorted) System.out.print(s2 + ); 和四个代码片段:s1:SortedSet sorted = s.tailSet(s.first();s2:SortedSet sorted = s.tailSet(s.first();s3:SortedSet sorted = (SortedSet)s.tailSet(s.first();s4:SortedSet sorted = (SortSet)s.tailSet(s.first();分别插入

12、到插入代码处,哪项可以编译?答案:A.S2B.S2和S3C.S2和S4D.S2、S3和S417以下哪些语句用于创建一个Map实例?答案: DA.Map m = new Map();B.Map m = new Map(init capacity,increment capacity);C.Map m = new Map(new Collection();D.以上都不对18现有如下类型:a - java.util.Hashtableb - java.util.Listc - java.util.ArrayListd - java.util.SortedSet和定义:1-使用本接口,允许用户控制集合

13、中每个元素的插入位置2-使用本集合,确保用户可以按照递增或元素的自然顺序遍历集合3-本具体类型允许空元素及基于索引的访问4-本集合是同步的哪一组匹配是对的?答案:A.2描述d,3描述bB.1描述b,3描述cC.3描述a,4描述bD.4描述a,2描述c19现有:public class Example public static void main(String args) /插入代码处 c.put(X, 123); 下列哪些插入到插入代码处能够正常编译?答案:A.Map c = new SortedMap();B.HashMap c = new HashMap();C.SortedMap c

14、= new TreeMap();D.Map c = new LinkedHashMap();20以下代码的执行结果是?public class Example public static void main(String args) File f = new File(c:large.txt); 答案:A.large.txt文件在本地硬盘上被创建B.在Unix系统上运行失败,因为路径分割符不正确C.large.txt文件在本地硬盘上没有被创建D.如果large.txt文件已经存在,则一个异常被抛出21以下说法正确的是()答案:A.RandomAccessFile类是File类的子类B.File

15、Writer类提供有操作基本数据类型的方法C.RandomAccessFile类提供有删除磁盘文件的方法D.File类提供有删除磁盘文件的方法22以下有关java.lang.Exception异常类的正确描述有?答案:BA.该类是一个公共类B.该类是Throwable类的子类C.该类实现了Throwable接口D.该类可以序列化23以下哪些集合接口支持重复元素存在?答案:BA.CollectionB.ListC.MapD.Set24现有如下代码:public class Example public static void main(String args) try int x=Integer

16、.parseInt(42a); /插入代码处 System.out.println(oops); 在插入代码处插入哪些语句可以在运行后输出oops?答案:CA. catch (IllegalArgumentException e) (非法参数异常)B. catch (IllegalStateException c) C. catch (NumbelFormatException n) D. catch (ClassCastException c) 25为了保证方法的线程安全,声明方法的时候必须使用哪个修饰符?答案:A.newB.transientC.voidD.synchronized26下列

17、代码执行后的结果是?public class Example public static void main(String args) try double x = 64.0; double y = 0.0; System.out.println(x % y = x % y); catch (Exception e) System.out.println(Exception); 答案:DA.编译失败B.运行时抛出异常C.打印输出trueD.打印输出false27下列代码执行后的结果是?public class Example public static void main(String arg

18、s) try System.out.println(Float.NaN = Float.NaN); System.out.println(Float.POSITIVE_INFINITY=Float.POSITIVE_INFINITY); catch (Exception e) System.out.println(Exception); 答案:DA.输出+G20:J20false falseB.输出ExceptionC.输出true trueD.输出false true28下列属于非受检异常(运行时异常)的是哪项?答案:AA.IOExceptionB.NullPointerExceptionC

19、.OutOfMemoryErrorD.29以下说法错误的是?答案:CA.Java中接口不能被private或Protected修饰符修饰B.Java中一个类可以实现多个接口,但是只能继承一个父类C.接口中定义的成员变量,即使不说明,默认均是publicstaticfinal的D.finalstaticnative关键字不能修饰接口,30请问以下哪个程序代码体现了对象之间的is a关系?答案:A.public interface Color public class Shape private Color color;B.public interface Component public cla

20、ss Cpmtaomer implements Component private Component children;C.public class Species public class Animal private Species species;D.public class Animal public interface Species private Species species;31给出以下代码,改程序的执行结果是?interface Base int k = 0;public class Example implements Base public static void m

21、ain(String args) int i; Example exm = new Example(); i = exm.k; i = Example.k; i = Base.k; System.out.println(i); 答案:DA.无内容输出B.代码编译失败C.代码运行时输出异常信息D.打印输出032现有以下代码:interface W class Z implements W class X extends Z class Y extends Z 下列哪些代码段是正确的?答案:A.X x=new X();Y y=new Y();Z z=new Z();y=(Y)x;B.X x=new

22、 X();Y y=new Y();Z z=new Z();x=(X)y;C.X x=new X();Y y=new Y();Z z=new Z();Z=(Z)x;D.X x=new X();Y y=new Y();Z z=new Z();W w=(W)x;33对以下两个代码片段说法正确的是?代码片段1: int a = 3; int b = 0; int c = a / b;代码片段2:float a = 3.0f;float b = 0.0f;float c = a / b;答案:CA.执行两端代码都会抛出异常B.执行两段代码都无异常抛出C.执行两段代码,只有代码片段1抛出异常D.执行两段代

23、码,只有代码片段2抛出异常34下列代码的执行结果是?class Example private void method1() throws Exception throw new RuntimeException(); public void method2() try method1(); catch (RuntimeException e) System.out.println(Caught Runtime Exception); catch (Exception e) System.out.println(Caught Exception); public static void mai

24、n(String args) throws IOException Example a = new Example(); a.method2(); 答案:A.代码编译失败B.输出Caught Runtime ExceptionC.输出Caught ExceptionD.输出Caught Runtime Exception和Caught Exception35关于trycatchfinally结构,描述正确的是些?答案:ACA.可以有多个catchB.只能有一个catchC.可以没有catchD.finally必须有36以下代码执行结果是?public abstract class Exampl

25、e extends Base public abstract void method();class Base public Base() throws IOException throw new IOException(); 答案:A.代码编译失败,因为非抽象类不能被扩展为抽象类B.代码编译失败,因为必须提供一个可以抛出或可以不抛出IOException异常的构造器C.代码编译失败,以in为必须提供一个可以抛出IOException异常或其子类的构造器D.代码编译成功37下列代码的执行结果是?class Example public static void main(String args)

26、 throws IOException int i = 1, j = 1; try i+; j-; if (i = j) j+; catch (ArithmeticException e) System.out.println(0); catch (ArrayIndexOutOfBoundsException e) System.out.println(1); catch (Exception e) System.out.println(2); finally System.out.println(3); System.out.println(4); 答案:CDA.输出1B.输出2C.输出3D

27、.输出438以下哪些是catch语句能够捕获处理的异常?答案:ACA.ThrowableB.ErrorC.ExceptionD.String39请问以下代码的直接执行结果是?class Example public static void main(String args) try System.out.println(args0); System.out.println(Im nomal); if (true) return; catch (Exception ex) System.out.println(Im exception); if (true) return; finally System.out.println(Im finally.); System.out.println(Out of try.); 答案:AA.Im exceptionIm finally

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2