Book Questions Test 1 Flashcards

1
Q

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

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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.

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A
B
C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A,B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

A,D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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.

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

A,B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly