Book Questions Test 1 Flashcards
In a diagram, how are objects distinguished from classes? Choose only one option
(a) Object labels are shown in italics
(b) Class labels have a box drawn around them
(c) Object labels are underlined
C
What is meant by ‘object identity? Choose only one option
(a) Two objects are identical if their attributes have the same value.
(b) Every object’s class has a unique serial number.
(c) All objects are the same as each other.
(d) Every object has a unique identity that distinguishes it from all other objects.
D
Which of the following terms best describes an object that is made up of other objects? Choose only one option . (a) Generalization
(b) Inheritance
(c) Association
(d) Aggregation
(e) Specialization
D
What is ‘encapsulation? Choose only one option
(a) Depicting objects using doughnut diagrams.
(b) Ensuring that the data inside an object can only be accessed via operations.
(c) Sealing the state of an object so that it cannot be changed.
(d) Putting objects into a collection.
B
Why is the ability to redefine a method important in object-oriented programming? Choose all options that apply.
(a) Because it allows us to add extra work to a method
(b) Because it allows us to introduce abstract methods that are redefined as concrete methods.
(c) Because it allows us to provide a more accurate or faster definition in a subclass
(d) Because it allows us to disable a method in a subclass
(e) Because it allows us to change the meaning of a method
A
B
C
Which of the following statements about multiple inheritance are true? Choose all options that apply
(a) It offers more modeling choices
(b) It makes it more difficult to write compilers and (fast) runtime systems
(c) It simplifies inheritance hierarchies
(d) It solves the problem of repeated inheritance.
A,B
Which of the following statements are true? Choose all options that apply
(a) Most superclasses are abstract
(b) Inheritance is preferable to composition.
(c) Most superclasses are concrete.
(d) Composition is preferable to inheritance
A,D
In UML diagrams, how are abstract classes distinguished from concrete classes? Choose only one option
(a) Concrete classes are shown as boxes with dashed outlines.
(b) Labels on abstract classes are shown in italics.
(c) Labels on concrete classes are shown in italics.
(d) Abstract classes are shown as boxes with dashed outlines
B
What is an abstract’ class? Choose only one option.
(a) An object.
(b) A class with no methods.
(c) A class with no concrete subclasses. (d) A class with at least one undefined message
(e) An interface.
D
Which of the following terms best describes the case where a Stack class is implemented using an internal instance of List? Choose only one option
(a) Association
(b) Specialization
(c) Genericity
(d) Composition
(e) Singularity
D
What can an object-oriented type system be used for? Choose only one option
(a) Improving runtime performance.
(b) Preventing misuse of a class
(c ) Avoiding spelling mistakes
(d) Making sure that all messages invoke a concrete method
(e) Documentation
(f) All of the above
(f) None of the above
F
What does the term polymorphismrefer to? Choose all options that apply
(a) The ability of a variable to point at different classes of object at different times.
(b) The fact that a message with the same signature can invoke different methods at different times
(c) All object-oriented programming languages are different
(d) All object-oriented methodologies use a different notation
A,B
What is a generic class? Choose only one option
(a) A class with no declared copyright
(b) A class that represents all objects
(c) A class that has other classes as parameters
C
Which of the following UML artifacts are used to show the distribution of processes resources and objects in a system? Choose only one option
(a) Interaction diagrams
(b) Sequence diagrams
(c) Deployment diagrams
(d) Communication diagrams
(e) state machine diagrams
(f) Class diagrams
(g) Glossaries
C
Which of the following UML artifacts is used to show the steps involved in getting value from a system? Choose only one option
(a) User interface sketches
(b) Glossaries
(c) State machine diagrams
(d) Use cases
(e) Class diagrams
(f) Deployment diagrams
D