欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    SCJP认证考试历年真题.pdf

    • 资源ID:90863328       资源大小:1.74MB        全文页数:30页
    • 资源格式: PDF        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    SCJP认证考试历年真题.pdf

    SCJP认证考试历年真题这都是考试原题,有心人可以收集收集,会让你收益匪浅!因为这一套较多,所以我分 将他罗列出来!310-025Leading the way in IT testing and certification tools,Question No:1Given:1.public class test(2.publie static void main(String args)3.int i=OxFFFFFFFl;4.int j=i;5.6.)7.)What is the decimal value of j at line 5?A.0B.1C.14D.-15E.An error at line 3 causes compilation to fail.F.An error at line 4 causes compilation to fail.Answer:DQuestion No:2Given:Integer i=new Integer(42);Long 1=new Long(42);Double d=new Double(42.0);Which two expressions evaluate to True?(Choose Two)A.(i=1)B.(i=d)C.(d=1)D.(i.equals(d)E.(d.equals(i)F.(i.equals(42)Answer:D,EQuestion No:3E xhibit:1.public class test(2.private static int j=0;3.4.private static boolean methodB(int k)(5.j+=k;6.return true;6.)7.8.public static void methodA(int i)9.boolean b:10.b=i 10 methodB(4);11.b=i 10 methodB(8);12.)13.14.public static void main(String args (15.methodA(0);16.system,out.println(j);17.)18.)What is the result?A.The program prints 0”B.The program prints 4”C.The program prints 8”D.The program prints 12”E.The code does not complete.Answer:BQuestion No:4Given1.Public class test(2.Public static void main(String args)(3.System.out.printin(6 3);4.)5.)What is the output?Answer:5Question No:5Given:1.publie class Foo 2.public static void main(String 口 args)3.StringBuffer a=new StringBuffer(A”);4.StringBuffer b=new StringBuffer(B );5.operate(a,b);6.system.out.printina+“,”+b;7.)8.static void operate(StringBuffer x,StringBuffery)9.x.append y;10.y=x;1 1.)12.Wha t is the resul t?A.The code compil es a nd prints“A,B”.B.The code compil es a nd prints“A,A”.C.The code compil es a nd prints“B,B”.D.The code compil es a nd prints“AB,B”.E.The code compil es a nd prints“AB,AB”.F.The code does not compil e beca use +ca nnot beoverl oa ded for String Buffer.Answer:DQuestion No:6Exhibit:1.Publ ic cl a ss test(2.Publ ic sta tic void string Repl a ce(String t e x t)(3.Text=text,repl a ce(,j ,,i);4.)5.6.publ ic sta tic void bufferRepl a ce(String Buffer text)7.text=text,a ppend(C)8.)9.10.public static void main(String args(11.String textString=new String(java”);12.StringBuffer text BufferString=new StringBuffer(“java”);13.14.stringReplace(textString);15.BufferReplace(textBuffer);16.17.System.out.printin(textString+textBuffer);18.19.)What is the output?Answer:javajavaCQuestion No:7E xhibit:1.public class test 2.public static void add3(Integer i)3.int val=i.intValue();4.val+=3;5.i=new Integer(val);6.)7.8.public static void main(String args )9.Integer i=new Integer(0);10.add3(i);11.system,out.printin(i.intValue();12.1 3.)What is the result?A.Compilation will fail.B.The program prints 0”.C.The program prints 3”.D.Compilation will succeed but an exception will bethrown at line 3.Answer:BQuestion No:8Given:1.public class ConstOver 2.public ConstOver(int x,int y,int z)3.)4.)Which two overload the ConstOver constructor?(ChooseTwo)A.ConstOver()B.Protected int ConstOver()C.Private ConstOver(int z,int y,byte x)D.Public Object ConstOver(int x,int y,int z)E.Public void ConstOver(byte x,byte y,byte z)Answer:A,CQuestion No:9Given:1.public class MethodOver 2.public void setVar(int a,int b,float c)3.)4.)Which two overload the setVar method?(Choose Two)A.Private void setVar(int a,float c,int b)B.Protected void setVar(int a,int b,float c)C.Public int setVar(int a,float c,int b)(returna;)D.Public int setVar(int a,int b,float c)(returna;)E.Protected float setVar(int a,int b,float c)(return c;)Answer:A,CQuestion No:10Given:1.class BaseClass 2.Private float x=1.Of;3.protected float getVar()(return x;)4.)5.class Subclass extends BaseClass(6.private float x=2.Of;7./in sert code here8.)Which two are valid examples of method overriding?(Choose Two)A.Float getVar()return x;B.Public float getVar()return x;C.Float double getVar()return x;D.Public float getVar()return x;E.Public float getVar(float f)return f;Answer:B,DQuestion No:11Which two demonstrate an is a”relationship?(ChooseTwo)A.public interface Person public class Employee extends Person B.public interface Shape public class Employee extends Shape C.public interface Color public class Employee extends Color D.public class Species public class Animal(private Species species;)E.interface Component Class Container implements Component(Private Component children;)Answer:D,EQuestion No:12Which statement is true?A.An anonymous inner class may be declared as final.B.An anonymous inner class can be declared as private.C.An anonymous inner class can implement multipleinterfaces.D.An anonymous inner class can access final variablesin any enclosing scope.E.Construction of an instance of a static inner classrequires an instance of the enclosing outer class.Answer:DQuestion No 13Given:1.package foo;2.3.public class Outer(4.public static class Inner(5.)6.)Which statement is true?A.An instance of the Inner class can be constructedwith“new Outer.Inner()”B.An instance of the inner class cannot be constructedoutside of package foo.C.An instance of the inner class can only beconstructed from within the outer class.D.From within the package bar,an instance of the innerclass can be constructed with“new inner。Answer:AQuestion No 14Exhibit:1.public class enclosingone(2.public class insideone 3.)4.public class inertest(5.publie static void main(stringargs)(6.enclosingone eo=new enclosingone();7./insert code here8.)9.)Which statement at line 7 constructs an instance of theinner class?A.InsideOnew ei=eo.new InsideOn();B.Eo.InsideOne ei=eo.new InsideOne();C.InsideOne ei=EnclosingOne.new InsideOne();D.EnclosingOne.InsideOne ei=eo.new InsideOne();Answer:DQuestion No 15Exhibit:1.interface foo 2.int k=0;3.4.5.public class test implements Foo(6.public static void main(String args)(7.int i;8.Test test=new test();9.i=test,k;10.i=Test,k;11.i=Foo.k;12.)13.)14.What is the result?A.Compilation succeeds.B.A n error at line 2 causes compilation to fail.C.An error at line 9 causes compilation to fail.D.An error at line 10 causes compilation to fail.E.A n error at line 11 causes compilation to fail.Answer:AQuestion No 16Given:1./point X2.public class foo(3.public static void main(Stringargs)throwsException 4.printWriter out=new PrintWriter(new5.java.io.outputStreamWriter(System,out),true;6.out.printin(Hello);7.)8.)Which statement at PointX on line 1 allows this codeto compile and run?A.Import java.io.PrintWriter;B.Include java.io.PrintWriter;C.Import java.io.OutputStreamWriter;D.Include java.io.OutputStreamWriter;E.No statement is needed.Answer:AQuestion No 17Which two statements are reserved words in Java?(Choose Two)A.RunB.ImportC.DefaultD.ImplementAnswer:B,CQuestion No 18Which three a re va l id decl a ra tions of a fl oa t?(ChooseThree)B.C.D.E.F.A.Fl oa t foo=-1;Fl oa t foo=1.0;Fl oa t foo=42el;Fl oa t foo=2.02f;Fl oa t foo=3.03d;Fl oa t foo=0 x0123;Answer:A,D,F这都是考试原题,有心人可以收集收集,会让你收益匪浅!因为这一套较多,所以我分4 将他罗列出来!310-025Lea ding the wa y in IT testing a nd certifica tion tool s,Question No:1Given:1.publ ic cl a ss test(2.public static void main(String args)3.int i:OxFFFFFFFl;4.int j=i;5.6.)7.)What is the decimal value of j at line 5?A.0B.1C.14D.-15E.An error at line 3 causes compilation to fail.F.An error at line 4 causes compilation to fail.Answer:DQuestion No:2Given:Integer i=new Integer(42);Long 1=new Long(42);Double d=new Double(42.0);Which two expressions evaluate to True?(Choose Two)A.(i=1)B.(i=d)C.(d=1)D.(i.equals(d)E.(d.equals(i)F.(i.equals(42)Answer:D,EQuestion No:3Exhibit:1.public class test(2.private static int j=0;3.4.private static boolean methodB(int k)(5.j+=k;6.return true;6.)7.8.public static void methodA(int i)9.boolean b:10.b=i 10|methodB(4);11.b=i 10|methodB(8);12.)13.14.public static void main(String args (15.methodA(0);16.system.out.println(j);17.)18.)What is the result?A.The program prints 0”B.The program prints“4”C.The program prints 8”D.The program prints“12”E.The code does not complete.Answer:BQuestion No:4Given1.Public class test(2.Public static void main(String args)(3.System,out.printin(6 3);4.)5.)What is the output?Answer:5Question No:5Given:1.publ ic cl a ss Foo 2.publ ic sta tic void ma in(String 口 a rg s)3.String Buffer a =new String Buffer(A”);4.String Buffer b=new String Buffer(B”);5.opera te(a,b);6.system.out.printl na +b);7.)8.sta tic void opera te(String Buffer x,String Buffery)9.x.a ppend y;10.y=x;1 1.)12.Wha t is the resul t?A.The code compil es a nd printsB.The code compil es a nd prints“A,B”“A,A”.C.The code compil es a nd prints“B,B”.D.The code compil es a nd printsE.The code compil es a nd prints“AB,AB”.F.The code does not compil e beca use ca nnot beoverl oa ded for String Buffer.Answer:DQuestion No:6Exhibit:1.Public class test(2.Public static void stringReplace(String t e x t)(3.Text=text,replace(j,,i);4.)5.6.public static void bufferReplace(StringBuffer text)(7.text=text,append(C”)8.)9.10.public static void main(String args (11.String textString=new String(java”);12.StringBuffer text BufferString=new StringBuffer(“java”);13.14.stringReplace(textString);15.BufferReplace(textBuffer);16.17.System,out.printin(textString+textBuffer);18.19.)What is the output?Answer:javajavaCQuestion No:7E xhibit:1.public class test 2.public static void add3(Integer i)3.int val=i.intValue();4.val+=3;5.i=new Integer(val);6.)7.8.publie static void main(String args )9.Integer i=new Integer(0);10.add3(i);11.system,out.printin(i.intValue();12.13.)What is the result?A.Compilation will fail.B.The program prints 0”.C.The program prints 3”.D.Compilation will succeed but an exception will bethrown at line 3.Answer:BQuestion No:8Given:1.public class ConstOver(2.public ConstOver(int x,int y,int z)3.)4.Which two overload the ConstOver constructor?(ChooseTwo)A.ConstOver()B.Protected int ConstOver()C.Private ConstOver(int z,int y,byte x)D.Public Object ConstOver(int x,int y,int z)E.Public void ConstOver(byte x,byte y,byte z)Answer:A,CQuestion No:9Given:1.public class MethodOver 2.publie void setVar(int a,int b,float c)3.)4.Which two overload the setVar method?(Choose Two)A.Private void setVar(int a,float c,int b)B.Protected void setVar(int a,int b,float c)C.Public int setVar(int a,float c,int b)(returna;)D.Public int setVar(int a,int b,float c)(returna;)E.Protected float setVar(int a,int b,float c)(return c;)Answer:A,CQuestion No:10Given:1.class BaseClass 2.Private float x=1.Of;3.protected float getVar()(return x;)4.5.class Subclass extends BaseClass(6.private float x=2.Of;7./insert code here8.)Which two are valid examples of method overriding?(Choose Two)A.Float getVar()return x;B.Public float getVarreturn x;C.Float double getVar()return x;D.Public float getVar()return x;E.Public float getVar(float f)return f;Answer:B,DQuestion No:11Which two demonstrate an is a”relationship?(ChooseTwo)A.public interface Person public class Employee extends Person B.publie interface Shape public class Employee extends Shape C.public interface Color public class Employee extends Color D.public class Species public class Animal(private Species species;)E.interface Component Class Container implements Component(Private Component chiIdren;)Answer:D,EQuestion No:12Which statement is true?A.An anonymous inner class may be declared as final.B.An anonymous inner class can be declared as private.C.An anonymous inner class can implement multipleinterfaces.D.An anonymous inner class can access final variablesin any enclosing scope.E.Construction of an instance of a static inner classrequires an instance of the enclosing outer class.Answer:DQuestion No 13Given:1.package foo;2.3.public class Outer(4.public static class Inner(5.)6.)Which statement is true?A.An instance of the Inner class can be constructedwith“new Outer.Inner()”B.An instance of the inner class cannot be constructedoutside of package foo.C.An instance of the inner class can only beconstructed from within the outer class.D.From within the package bar,an instance of the innerclass can be constructed with“new inner()nAnswer:AQuestion No 14E xhibit:1.public class enclosingone(2.public class insideone(3.)4.public class inertest(5.public static void main(stringargs)(6.enclosingone eo=new enclosingone();7./insert code here8.)9.)Which statement at line 7 constructs an instance of theinner class?A.InsideOnew ei=eo.new InsideOn();B.Eo.InsideOne ei=eo.new InsideOne();C.InsideOne ei=EnclosingOne.new InsideOne();D.EnclosingOne.InsideOne ei=eo.new InsideOne();Answer:DQuestion No 15Exhibit:1.interface foo 2.int k=0;3.4.5.public class test implements Foo(6.public static void main(String args)(7.int i;8.Test test=new test();9.i=test,k;10.i=Test,k;11.i=Foo.k;12.)13.)14.What is the result?A.Compilation succeeds.B.An error at line 2 causes compilation to fail.C.D.E.An error at line 9 causes compilation to fail.An error at line 10 causes compilation to fail.An error at line 11 causes compilation to fail.Answer:AQuestion No 16Given:1./point X2.public class foo(3.public static void main(Stringargs)throwsException 4.printWriter out=new PrintWriter(new5.java.io.outputStreamWriter(System,out),true;6.out.printin(Hello);7.)8.)Which statement at PointX on line 1 allows this codeto compile and run?A.Import java.io.PrintWriter;B.Include java.io.PrintWriter;C.Import java.io.OutputStreamWriter;D.Include java.io.OutputStreamWriter;E.No statement is needed.Answer:AQuestion No 17Which two statements are reserved words in Java?(Choose Two)A.RunB.ImportC.DefaultD.ImplementAnswer:B,CQuestion No 18Which three are valid declarations of a float?(ChooseThree)A.Float foo=-1;B.Float foo=1.0;C.Float foo=42el;D.Float foo=2.02f;E.Float foo=3.03d;F.Float foo=0 x0123;Answer:A,D,F

    注意事项

    本文(SCJP认证考试历年真题.pdf)为本站会员(无***)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开