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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

Java试题及答案英文版doc.docx

1、Java试题及答案英文版doc1 Which two dem on strate an uis a” relati on ship? (Choose Two)A.public interface Person public class Employee exte nds Pers on B.public interface Shape public class Employee extends Sha pe C.public in terface Color public class Employee extends Color D.public class Species public cl

2、ass Animalprivate Species species;E.in terface Comp orient Class Container implements Component (Private Component children;Answer:de2.Given:1.package foo;2.2.public class Outer (3.public static class Inn er (4.)5.)Which statement is true?A.An instance of the Inner class can be constructed with “new

3、 Outernner ()”B.An instance of the inner class cannot be constructed outside of package fooC.An instance of the inner class can only be constructed from within the outer classD.From within the package bar, an instanee of the inner class can be constructed with “new inner()nAnswer:c3. Exhibit:1public

4、 class enclosinggone2public class insideone34public class inertest5public static void main (Stringf args)6enclosingone eo = new enclosingone();7/insert code here8Which state me nt at li ne 7 con structs an instance of the inner class?A.InsideOne ei = eo.new lnsideOne();B.B. EonsideOne ei = eo.new In

5、sideOne();C InsideOne ei = EnclosingOne.new InsideOne();D.EnclosingOne InsideOne ei = eo.new lnsideOne();An swer:aC.4.D.1) class SuperE.2) public float getNum()return 3.Of;F3) G.4)H.5) public class Sub extends SuperI.6)J 7) K. which method, placed at line 6, will cause a compiler error?L.A. public f

6、loat getNum()return 4.Of;M. B. public void getNum()N. C. public void getNum(double d)O. D. public double getNum(float d)return 4.0d;Answer:B5.1)public class Foo2)public static void main(String args)3)tryreturn;4)finally! System.out.println(Finally,);5)6)what is the result?A.The program runs and prin

7、ts nothing.B.The program runs and prints “Finally”.C.The code compiles, but an exceptio n is thrown at run time D.The code will not compile because the catch block is missing.Answer:b6/point Xpublic class Foopublic static void main(String args)PrintWriter out=new PrintWriter(newjava.io.OutputStreamW

8、riter(System.out),true);out.println(,HelloH);which statement at point X on line 1 allows this code to compile and run?A.import java.io.PrintWriter B.inelude java.io.PrintwriterC.import java.io.OutputStreamWriter D.include java.io.OutputStreamWriterE.No state me nt is n eededAnswer:a6.which three are

9、 valid declaraction of a float?A.float foo=-1;B.float foo=1.0;C.float foo=42e1;D.float foo=2.02f;E.float foo=3.03d;F.float foo=0x0123;An swer:adf8.int index=1;int foo=new int3;int bar=fooindex;int baz=bar+index;what is the result?A.baz has a value of 0B.baz has value of 1C.baz has value of 2D.an exc

10、eption is thrownE.the code will not compileAnswer:b9.1)int i=1,j=10;2)do3)if(i+-j) continue; 192837464)while(ij)continue;卜; while(+iv6);what are the vale of i and j?A.i=6,j=5B.i=5,j=5C.i=6,j=4D.i=5,j=6E.i=6,j=6Answer: A20byte arrayl ,array2byte array3byte array4if each has been initialized, which st

11、atement will cause a compile error?A.array2 = arrayl;B.array2 = array3;C.array2 = array4;D.both A and BE.both A and CF.both B and CAnswer: a21.which four types of objects can be thrown use ”throws”?A.ErrorB.EventC.ObjectD.Excpti onE.ThrowableF.Run timeExcepti onAnswer: A,D,E, F22.1)public class Test

12、2)public static void main(String args)3)unsigned byte b=0;4)b-;5)5)6)what is the value of b at line 5?A.-1 B.255 C.127 D.compile fail E.compile succeeded but run errorAnswer: d23.public class ExceptionTestclass TestException extends Exceptionpublic void runTest() throws TestExceptionpublic void test

13、() /* point x */ run Test();At point x, which code can be add on to make the code compile?A.throws ExceptionB.catch (Exception e)C.throws RuntimeExceptionD.catch (TestException e)E.no code is necessaryAnswer: A24String foo=”blue”;boolean bar=new boolean1;if(barO)foo=HgreenH;what is the value of foo?

14、A.” B.null C.blue D.gree nAnswer: C25.which two are equivale nt?A.3/2B.32C.3*4D.32E.3*2A2F.32Answer: c,d26.int index=1;String test=new String3;String foo=testindex;what is the result of foo?A.foo has the value “ ”B.foo has the value nullC.an exception is thrownD.the code will not compileAn swer: b27

15、.which two are true?A.static inner class requires a static initializerB.A static inner class requires an instanee of the enclosing classC.A static inner class has no ref ere nee to an in stance of the enclosi ng classD.A static inner class has accesss to the nonstatic member of the other classE.stat

16、ic members of a static inner class can be ref ere need using the class name of the static inner classAnswer: c,e28.You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access modifier that will accomplish this objective?A.PublicB.PrivateC.Protec

17、tedD.TransientE.No access modifier is qualifiedAn swer:c29.Given:1.abstract class abstrctlt 2.abstract float getFloat ();3.)4.public class AbstractTest extends Abstractly5.private float f1= 1.0f;6.private float getFloat () return f1:7What is the result?A.Compilation is successful.B.An error on line 6 causes a run time failure.C.An error at line 6 causes compilation to fail.D.An error at line 2 causes compilation to fail.An s

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1