网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

In looking at the class structure of an entire system, we may find that its inheritance (1) is either wide and shallow, narrow and deep, or balanced. Class structures that are wide and shallow usually represent forests of (2) classes that can be mixed and matched. Class structures that are narrow and deep represent trees of classes that are related by a common ancestor. There are advantages and disadvantages to each approach. Forests of classes are more loosely (3) , but they may not exploit all the commonality that exists. Trees of classes exploit this commonality, so that individual classes are smaller than in forests. However, to understand a particular class, it is usually necessary to understand the meaning of all the classes it inherits from or uses. The proper shape of a class structure is highly problem-dependent. We must make similar trade-offs among inheritance, aggregation, and using relation- ships. For example, should the class Car inherit, contain, or use the classes named Engine and Wheel? In this case, we suggest that an (4) relationship is more appropriate than inheritance relationship. Meyer states that between the class A and B," (5) is appropriate if every instance of B may also be viewed as an instance of A. The client relationship is appropriate when every instance of B simply possesses one or more attributes of A". From another perspective, if the behavior. of an object is more than the sum of its individual parts, then creating an aggregation relationship rather than an inheritance relationship between the appropriate classes is probably superior.

A.distinction

B.level

C.grade

D.hierarchy


参考答案

更多 “ In looking at the class structure of an entire system, we may find that its inheritance (1) is either wide and shallow, narrow and deep, or balanced. Class structures that are wide and shallow usually represent forests of (2) classes that can be mixed and matched. Class structures that are narrow and deep represent trees of classes that are related by a common ancestor. There are advantages and disadvantages to each approach. Forests of classes are more loosely (3) , but they may not exploit all the commonality that exists. Trees of classes exploit this commonality, so that individual classes are smaller than in forests. However, to understand a particular class, it is usually necessary to understand the meaning of all the classes it inherits from or uses. The proper shape of a class structure is highly problem-dependent. We must make similar trade-offs among inheritance, aggregation, and using relation- ships. For example, should the class Car inherit, contain, or use the classes named Engine and Wheel? In this case, we suggest that an (4) relationship is more appropriate than inheritance relationship. Meyer states that between the class A and B," (5) is appropriate if every instance of B may also be viewed as an instance of A. The client relationship is appropriate when every instance of B simply possesses one or more attributes of A". From another perspective, if the behavior. of an object is more than the sum of its individual parts, then creating an aggregation relationship rather than an inheritance relationship between the appropriate classes is probably superior.A.distinctionB.levelC.gradeD.hierarchy ” 相关考题
考题 36. We ___________ keep the new traffic law and learn how to protect ourselves.A.may.B.shouldC.canD.need

考题 以下语句能顺利通过编译: class class1 { private int i=5; //i为私有属性!! } public class class2 { public static void main(String args[]) { class1 cs1=new class1(); System.out.println(cs1.i); } } 。() 此题为判断题(对,错)。

考题 以下语句能顺利通过编译: class class1 { protected int i=5; //i为保护属性 } public class class2 { public static void main(String args[]) { class1 cs1=new class1(); System.out.println(cs1.i); } }。() 此题为判断题(对,错)。

考题 根据以下内容,回答235-239题。 What is the last day to apply for the WHC position? (  )A.May 1 B.May 10 C.May 17 D.May 27

考题 44、第三方库bs4中,find_all() 方法find_all(name , attrs , recursive , string , **kwargs ) 如果想查找只符合某一个条件的特定标签内容,可以结合使用name、attrs两个参数, attrs 参数定义一个字典参数来搜索包含特殊属性的tag。如下所示: find_all(name="p",attrs={"class": "tem"}) 是将<p>标签中,属性为class,属性class的值为“tem”的那一组(或一个)<p>标签。

考题 下面英文日期写法错误的是____?A.May 1, 2015B.1 May,2015C.1 May 2015D.May 1st, 2015

考题 阅读下列代码,选出该代码段正确的文件名()。 class A{ void method1(){ System.out.println("Method1 in class A"); } } public class B{ void method2(){ System.out.println("Method2 in class B"); } public static void main(String[] args){ System.out.println("main() in class B"); } }A.javaB.A.classC.B.javaD.B.class

考题 真核生物ITS序列由ITS1和ITS2两部分组成。

考题 7、查找城市天气数据时,若要使用BeautifulSoup中的find()方法,则可以使用网页标签及标签属性来定位到对应的数据。例如:soup.find('p', class_="tem").text

考题 如下 java程序对应的程序文件名为为 public class DemoProgram2_1 { public static void main(String[] args) { System.out.println("hello world!"); } }A.DemoProgram2_1B.DemoProgram2_1.javaC.DemoProgram.javaD.DemoProgram2_1 .class