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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

分布式架构第十八单元试题及答案.docx

1、分布式架构第十八单元试题及答案分布式架构第十八单元试题及答案您的姓名: 填空题 *_下面代码Java变量定义正确的是35. String #name=Jane Doe36. int %age = 24;37. Double _height = 123.5;38. double temp = 37.5; 单选题第35行第36行第37行(正确答案)第38行public class TestString public static void main(String args) String str = 420; str += 42; System.out.println(str); 输出结果是: 单

2、选题4242046242042(正确答案)public class Test public static void main(String args) int x = 5; boolean b1 = true; boolean b2 = false; if(x=4) & !b2) System.out.println(1 ); System.out.println(2 ); if(b2=true) & b1) System.out.println(3 ); 输出结果是: 单选题231 22 3(正确答案)public void go() String o = ; z: for(int x=0;

3、i3;x+) for(int y=0;y2;y+) if(x = 1) break; if(x=2 & y=1) break z; o = o + x + y; System.out.println(o);输出结果是: 单选题000001000120(正确答案)00012021int x = 0;int y = 10;do y-; +x;while(x5);System.out.println(x+,+y);输出结果是: 单选题5,65,5(正确答案)6,56,6public class Breaker static String o = ; public static void main(S

4、tring args) z: o = o + 2; for(int x=3;x8;x+) if(x = 4) break; if(x = 6) break z; o = o + x; System.out.println(o); 输出结果是: 单选题23234234567编译错误(正确答案)public class Breaker2 static String o = ; public static void main(String args) z: for(int x=2;xdistance)(story*2)=tail) System.out.println(1); if(distance

5、+1 != tail)(story*2)=distance) System.out.println(2); 输出结果是: 单选题1212无输出(正确答案)String elements = for,tea,too;String first = (elements.length0)?elements0:null;输出结果是: 单选题编译错误运行时抛出异常first赋值为nullfirst赋值为elements0(正确答案)import java.util.*;public class Quest public static void main(String args) String colors

6、=blue,red,green,yellow,orange; Arrays.sort(colors); int s2 = Arrays.binarySearch(colors,orange); int s3 = Arrays.binarySearch(colors,violet); System.out.println(s2+ +s3); 输出结果是: 单选题2-12-42-5(正确答案)编译错误class Alligator public static void main(String args) int x = 1,2,3,4,5,6,7,8,9; int y = x; System.ou

7、t.println(y21); 输出结果是: 单选题237(正确答案)编译错误public class Barn public static void main(String args) new Barn().go(hi,1); new Barn().go(hi,world,2); public void go(String. y,int x) System.out.println(yy.length-1+ ); 输出结果是: 单选题hi hihi worldworld world编译错误(正确答案)class Person String name = No name; public Pers

8、on(String nm)name = nm;class Employee extends Person String empId = 0000; public Employee(String id)empId = id;class EmployeeTest public static void main(String args) Employee e = new Employee(4321); System.out.println(e.empId); 输出结果是: 单选题43210000运行时抛出异常编译错误(正确答案)class Mud /将下面代码放到这里, System.out.pri

9、ntln(hi); 一共有多少选项可以正常编译public static void main(String.a)public static void main(String.* a)public static void main(String. a)public static void main(String. a)public static void main(String. a) 单选题0123(正确答案)class Atom Atom()System.out.print(atom );class Rock extends Atom Rock(String type)System.out.

10、print(type);public class Mountain extends Rock Mountain() super(granite ); new Rock(granite ); public static void main(String a)new Mountain();输出结果是: 单选题编译错误atom granitegranite granite(正确答案)atom granite atom granitepublic class Blip protected int blipvert(int x)return 0;class Vert extends Blip /下面代码

11、放在这里1. public int blipvert(int x)return 0;2. private int blipvert(int x)return 0;3. private int blipvert(long x)return 0;4. protected long blipvert(int x)return 0;5. protected int blipvert(long x)return 0;6. protected long blipvert(long x)return 0;7. protected long blipvert(int x,int y)return 0;一共有多

12、少选项放在上面可以正常编译 单选题0245(正确答案)1.class Super2.3. private int a;4. protected Super(int a)this.a = a;5.6.class Sub extends Super7.8. public Sub(int a)super(a);9. public Sub()this.a = 5;10.上面代码如下修改可以编译通过 单选题修改第2行为public int a;修改第2行为protected int a;修改第13行为public Sub()this(5);(正确答案)修改第13行为public Sub()super(a

13、);class Batman int squares = 81; public static void main(String args) new Batman().go(); void go() incr(+squares); System.out.println(squares); void incr(int squares)squares+=10;输出结果是: 单选题8182(正确答案)9192class Pass public static void main(String args) int x = 5; Pass p = new Pass(); p.doStuff(x); Syst

14、em.out.println( main x = +x); void doStuff(int x) System.out.println( doStuff x = +x+); 输出结果是: 单选题编译错误运行时抛出异常doStuff x=6 main x=6doStuff x=5 main x=5(正确答案)class ClassA public int numberOfInstances; protected ClassA(int numberOfInstances) this.numberOfInstances=numberOfInstances; class ExtendedA exte

15、nds ClassA private ExtendedA(int numberOfInstances) super(numberOfInstances); public static void main(String args) ExtendedA ext = new ExtendedA(420); System.out.println(ext.numberOfInstances); 输出结果是: 单选题420(正确答案)运行时抛出异常所有构造方法必须声明为public构造方法不能声明为私有class One void foo()class Two extends One /下面代码放在这里一

16、共有多少选项可以放在上面可以正常编译1.int foo()2.void foo()3.public void foo()4.private void foo()5.protected void foo() 单选题013(正确答案)2class X X()System.out.print(1); X(int x) this(); System.out.print(2); public class Y extends X Y() super(6); System.out.print(3); Y(int y) this(); System.out.println(4); public static

17、void main(String a)new Y(5);输出结果是: 单选题131341234(正确答案)2134public class Hi void m1() protected void m2()class Lois extends Hi /下面哪些代码可以放在这里输出结果是:public void m1()(正确答案)protected void m1()(正确答案)private void m1()void m2()class One public One foo()return this;class Two extends One public One foo()return t

18、his;class Three extends Two /下面哪些代码可以放在这里A.public void foo()B.public int foo()return 3;C.public Two foo()return this;D.public One foo()return this;public void foo()public int foo()return 3;public Two foo()return this;(正确答案)public One foo()return this;(正确答案)class Employee String name;double baseSalar

19、y; public Employee(String name,double baseSalary) this.name = name; this.baseSalary = baseSalary; public class SalesPerson extends Employee double commission; public SalesPerson(String name, double baseSalary,double commission) /下面哪些代码可以放在这里编译运行 super(name,baseSalary);(正确答案)mission = commission;supe

20、r();mission = commission;super(name,baseSalary);mission = commission;(正确答案)public abstract class Shape private int x; private int y; public abstract void draw(); public void setAnchor(int x,int y) this.x = x; this.y = y; 下面定义正确的是:public class Circle implements Shape private int radius;public abstrac

21、t class Circle extends Shape private int radius;(正确答案)public class Circle extends Shape private int radius; public void draw();public class Circle extends Shape private int radius; public void draw();(正确答案)class ClassAclass ClassB extends ClassAclass ClassC extends ClassAClassA p0 = new ClassA();Cla

22、ssB p1 = new ClassB();ClassC p2 = new ClassC();ClassA p3 = new ClassB();ClassA p4 = new ClassC();下面哪几个赋值语句是合法的p0=p1(正确答案)p1=p2p1 = (ClassB)p3(正确答案)p2 = (ClassC)p4(正确答案)class ThingyMeter m = new Meter();class Component void go()System.out.print(c);class meter extends Component void go()System.out.pri

23、nt(m);class DeluxeThingy extends Thingy public static void main(String args) DeluxeThingy dt = new DeluxeThingy(); dt.m.go(); Thingy t = new DeluxeThingy(); t.m.go(); 下面描述正确的是:输出mm(正确答案)输出mcDeluxeThingy has-a Component(正确答案)以上都不对abstract public class Employee protected abstract double getSaleAmount(

24、); public double getCommision() return getSalesAmount()*0.15; class Sales extends Employee /下面哪些代码放在这里可以正确运行double getSalesAmount()return 1230.45;public double getSalesAmount()return 1230.45;(正确答案)private double getSalesAmount()return 1230.45;protected double getSalesAmount()return 1230.45;(正确答案)pub

25、lic interface Status /*下面哪些修饰符可以放在这里*/ int MY_VALUE=10;final(正确答案)static(正确答案)nativepublic(正确答案)下面哪些类正确实现java.lang.Runnable和java.lang.Cloneable接口public class Session implements Runnable,Cloneable public void run(); public Object clone();public class Session extends Runnable,Cloneable public void run

26、(). public Object clone().public class Session implements Runnable,Cloneable public void run(). public Object clone().(正确答案)public abstract class Session implements Runnable,Cloneable public void run(). public Object clone().(正确答案)10.interface Foo11. int bar();12.13.14.public class Beta15.16. class

27、A implements Foo17. public int bar()return 1;18. 19.20. public int fubar(Foo foo)return foo.bar();21.22. public void testFoo()23.24. Class A implements Foo25. public int bar()return 2;26. 27.28. System.out.println(fubar(new A();29. 30.31. public static void main(String argv)32. new Beta().testFoo();

28、33. 34.下面哪些语句是正确的编译错误代码可以编译,运行输出2(正确答案)如果第16,17,18行删除,输出2(正确答案)如果第24,25,26行删除,输出1(正确答案)Java语言是编译类型语言 判断题对错(正确答案)同一个JVM中同一个的类可以被加载多次 判断题对(正确答案)错long类型8个字节,float类型4个字节,long类型中最大数比float类型中最大的数要更大 判断题对错(正确答案)Java语言无法调用C语言编写的DLL动态链接库 判断题对错(正确答案)在Java语言中字符A占一个字节,汉字中占两个字节 判断题对错(正确答案)在Java语言中int和char类型可以相互转换 判断题对(正确答案)错在Java语言中可以集成父类的方法和属性,我们可以写一个类继承java.lang.String 判断题对错(正确答案)Java语言中,有八种基本数据类型 判断题对(正确答案)错Java可以开发桌面程序,也可以开发服务器端程序 判断题对(正确答案)错Java类中启动方法可以是public static void main(String arg) 判断题对(正确答案)错

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

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