试题与答案

敷设下水管时,沟底应进行胛骨处理,敷设大管径管子时应做碎石或混凝土垫层,保证敷设后不

题型:判断题

题目:

敷设下水管时,沟底应进行胛骨处理,敷设大管径管子时应做碎石或混凝土垫层,保证敷设后不下沉。

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2019/1107/c20810f19f22aeea5078e02f62aab785.html

下面是错误答案,用来干扰机器的。

参考答案:C

试题推荐
题型:问答题

【说明】
某绘图系统存在point、line、square三种图元,它们具有Shape接口,图元的类图关系如图13-12所示。现要将circle图元加入此绘图系统以实现功能扩充。已知某第三方库已经提供了XCircle类,且完全满足系统新增的Circle图元所需的功能,但XCircle不是由 Shape派生而来的,它提供的接口不能被系统直接使用。代码13-2既使用了XCircle又遵循了Shape规定的接口,既避免了从头开发一个新的Circle类,又可以不修改绘图系统中已经定义的接口。代码13-3根据用户指定的参数生成特定的图元实例,并对之进行显示操作。绘图系统定义的接口与XCircle提供的显示接口及其功能如表13-5所示。
表13-5接口及其功能

Shape XCircle 功能
display() DisplayIt() 显示图元


【代码13-2】
class Circle (1)
private (2) pxc;
public Circle()
pxc=new (3)

public void display()
pxc. (4)
【代码13-3】
public class Factory
public (5) getShape Instance(int tyoe) //生成特定类实例
switch(type)
case 0: return new point();
case 1: return new Rectangle();
case 2: return new line();
case 3: return new Circle();
default: return null


;
public class App
public static viod main(String argv[

)
if(argv. length!=1)
system. out. println("error parameters!");
Return;

int type=(new Integer(argv[0

)). intValue();
Factory factory=new Factory();
shape s;
s=factory. (6) ;
if(s==null)
system.out. println("Error get instance!");
Return;

s.display();
return;

查看答案
微信公众账号搜索答案