This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “Object and Design-2 ”.
1. ________ are used in class diagrams to describe the way in which specific elements should be used.
a) Attributes
b) Constraints
c) Constants
d) Class Names
View Answer
Explanation: The {abstract} syntax is an example of a constraint. There is no special structure for the text between the braces; it should simply provide a short clarification of any conditions that may apply to the element.
2. Which one of the following is displayed below the class name in the class diagrams?
a) Functions
b) Methods
c) Attributes
d) Constraints
view Answer
Explanation: Attributes describe a class’s properties. Attributes are listed in the section directly beneath the class name.
3. + is the visibility code for?
a) Public
b) Private
c) Protected
d) Friendly
View Answer
Explanation: The visibility symbol is followed by the name of the attribute.
4. Which relationship is illustrated by a line that begins with an unfilled diamond?
a) Composition
b) Abstraction
c) Aggregation
d) Inheritance
View Answer
Explanation: In the case of aggregation, the contained objects are a core part of the container, but they can also be contained by other objects at the same time.
5. If the diamond is filled it depicts which relationship?
a) Strong Aggregation
b) Composition
c) Abstraction
d) Inheritance
View Answer
Explanation: In composition, the contained object can be referenced by its container only. It should be deleted when the container is deleted.
6. Which one of the following statements is true about sequence diagrams?
a) A sequence diagram is class based
b) A sequence diagram presents the participants of a system from right to left
c) The vertical broken lines represent the lifetime of the class in the system
d) A sequence diagram is object based
View Answer
Explanation: A sequence diagram is object based rather than class based. It is used to model a process in a system step by step.
7. A bidirectional relationship in class diagrams is described by________
a) double-headed arrow
b) visibility symbols
c) single-headed arrow
d) double diamond
View Answer
Explanation: A unidirectional association has single-headed arrow.
8. # is the visibility code for?
a) Private
b) Friendly
c) Protected
d) Static
View Answer
Explanation: Available to the current class and its subclasses only.
9. Which one of the following is displayed in the third section of the class diagram?
a) Operations
b) Inheritance
c) Abstraction
d) Coupling
View Answer
Explanation: Operations describe methods, or more properly, they describe the calls that can be made on an instance of a class.
10. Inheritance in class diagrams is depicted by________
a) single-headed empty arrow
b) single-headed filled arrow
c) double-headed empty arrow
d) double-headed filled arrow
view Answer
Explanation: The UML describes the inheritance relationship as a generalization. This relationship is signified by a line leading from the subclass to its parent. The line is tipped with an empty closed arrow.
Sanfoundry Global Education & Learning Series – PHP Programming.
To practice all areas of PHP Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on PHP.
- Apply for Programming Internship
- Practice Programming MCQs
- Check PHP Books
- Check Information Technology Books
- Practice MCA MCQs