True / False 1. Inheritance models < has a, isa > relationships. 2. A disadvanta
ID: 3616876 • Letter: T
Question
True / False
1. Inheritance models <has a, isa> relationships.
2. A disadvantage of using inheritance indesigning programs is that such programs tend to belonger.
3. In UML, types are shown <before, after>a colon.
4. In designing a system, a designer generallystarts with superclasses and then figures out thesubclasses.
5. When designing class hierarchy, the bestpractice is to put shared messages a <high, low> as possiblein the hierarchy.
6. The <attributes, messages> of a classrepresent its interface to the outside world.
7. Generally, designers identify the<attributes, messages> of a class before its <messages,attributes>
8. In UML class diagrams, <Message names,method names> are in italics to differentiate them from<method names, message names>.
9. <Abstract, concrete> method names arewritten in italics in UML class diagrams.
10. Abstract methods may be inherited bysubclasses from superclasses.
11. Most OOP languages don’t allowinstantiation of abstract classes.
12. Most superclasses in a class hierarchy areabstract.
13. Class hierarchies are generally derived fromthe <bottom up, top down>.
14. UML rules require abstract classes haveabstract methods.
15. Generally, if a concrete class is derivedfrom another concrete class early in the design process, it is wiseto transform the design so that concrete classes derive fromabstract classes.
16. Generally, a good way to add functionality toan existing class is to create subclass that implements thatfunctionality
17. A <superclass, subclass> may redefineelements of a <subclass, superclass>.
18. OOP languages allow a method that redefinesanother to invoke the method that was redefined.
19. OOP languages prevent a method that redefinesanother from invoking the method that was redefined.
20. In UML class diagrams, a <black, clear,white> <circle, diamond, triangle> is put on the lineconnecting the two classes to show composition.
21. When a class is made by composition, the<composed, composite> class is said to delegate its behaviorto the <composite, composed> class.
Chapter 3 Question Pool / CS350 / Spring 20102
22. Generally, <inheritance, composition>is easier to do than <composition, inheritance>.
23. Generally, <inheritance, composition >is easier to change than < composition, inheritance> whendesign deficiencies are discovered.
24. Generally, composition accomplishes the samething as inheritance <and is easier, but is harder> touse.
25. In inheritance, a leakis when methods inappropriate for a subclassare inherited and exposed to user of the subclass.
26. <Inheritance, composition> is genrallyeasier for beginning designers.
27. Private inheritance allows a class to inheritfrom another class without inherited elements becoming part of theinterface of the new class.
28. <Single, multiple> inheritance iscloser to the real world than <multiple, single>inheritance.
29. Not all OOP languages support multipleinheritance.
30. Generally, is it wise to <use, not use>multiple inheritance.
Short Answer
31. <class name> and <class name>inherit from <class name>. Draw a UML class diagram showingthis relationship.
32. <class name> and <class name>inherit from <class name>, and all three share the message<message name>. Draw a UML class diagram showing thisrelationship and the message.
33. What is an <abstract, concrete>method?
34. In UML class diagrams, when it is notpractical to use italics to show abstract methods, what alternativeis used?
35. What is an abstract class?
36. What is one of the advantages of usingabstract classes in OOD?
37. When designing class hierarchies, what kindsof classes are usually discovered first?
38. How would a class redefinean inherited method?
39. What are the three reason a designer mightredefine an inherited method?
40. What is the "contract" a redefined method haswith its users?
41. When using composition, when is the composedobject usually instantiated?
42. <Class name> is defined by composing<class name>. Draw a UML diagram showing the relationshipbetween the two classes.
43. Why should private inheritance be avoided bydesigners?
44. What type of inheritance allows a class tohave two or more parents?
45. <Description of classes where multipleinheritance is obvious, such as shown in figure 3.11>, draw aUML diagram showing the relationships among the classes.
46. When using multiple inheritance, what isa nameclash?
47. When using multiple inheritance, whatis repeatedinheritance?
Explanation / Answer
True / False
1. Inheritance models <isa> relationships.
2. A disadvantage of using inheritance indesigning programs is that such programs tend to be longer. <false>
3. In UML, types are shown <before> acolon.
4. In designing a system, a designer generallystarts with superclasses and then figures out the subclasses.<true>
5. When designing class hierarchy, the bestpractice is to put shared messages a <low> as possible in thehierarchy.
6. The <attributes> of a class representits interface to the outside world.
7. Generally, designers identify the<attributes> of a class before its<messages>
8. In UML class diagrams, <method names>are in italics to differentiate them from messagenames>.
9. <Abstract,> method names are written initalics in UML class diagrams.
10. Abstract methods may be inherited bysubclasses from superclasses. <true>
11. Most OOP languages don’t allowinstantiation of abstract classes. <false>
12. Most superclasses in a class hierarchy areabstract. <true>
13. Class hierarchies are generally derived fromthe <top down>.
14. UML rules require abstract classes haveabstract methods. <false>
15. Generally, if a concrete class is derivedfrom another concrete class early in the design process, it is wiseto transform the design so that concrete classes derive fromabstract classes. <true>
16. Generally, a good way to add functionality toan existing class is to create subclass that implements thatfunctionality <false>
17. A <subclass> may redefine elements of a<superclass>.
18. OOP languages allow a method that redefinesanother to invoke the method that was redefined.<true>
19. OOP languages prevent a method that redefinesanother from invoking the method that was redefined. <false>
20. In UML class diagrams, a <black><diamond> is put on the line connecting the two classes toshow composition.
21. When a class is made by composition, the<composite> class is said to delegate its behavior to the<composed> class.
Chapter 3 Question Pool / CS350 / Spring 20102
22. Generally, <inheritance> is easier todo than <composition>.
23. Generally, <inheritance> is easier tochange than < composition> when design deficiencies arediscovered.
24. Generally, composition accomplishes the samething as inheritance <but is harder> to use.
25. In inheritance, a leakis when methods inappropriate for a subclassare inherited and exposed to user of the subclass.<true>
26. <Inheritance is genrally easier forbeginning designers.
27. Private inheritance allows a class to inheritfrom another class without inherited elements becoming part of theinterface of the new class. <false>
28. <Single> inheritance is closer to thereal world than <multiple> inheritance.
29. Not all OOP languages support multipleinheritance. <True>
30. Generally, is it wise to <not use>multiple inheritance.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.