UML MCQ

UML Diagrams MCQs Questions With Answers – Part 10

Test your knowledge and boost your confidence with these multiple-choice quizzes focused on UML diagrams, foundational software engineering concepts, and real-world best practices. Designed for students, developers, and exam candidates, these MCQs offer a quick and effective way to assess your understanding and sharpen your skills.
 
 

1. In a UML class diagram, what does “1..*” mean?

A The element is optional

B It can be null or unique

C There is exactly one instance

D There is at least one instance

D
The multiplicity 1..* means there must be at least one instance (but potentially more). Unlike 0..*, which allows zero.

 

2. What does the notation ~ before a method in a class diagram mean?

A Private

B Package (default)

C Abstract method

D Protected

B
~: package (accessible only within the same package). Example:
 

The ~ symbol in UML is used to define a package visibility, meaning the element is only accessible within the package, not outside.
 

3. What is the main difference between a class diagram and an object diagram?

A The class diagram shows the actual execution

B The class diagram shows the abstract structure; the object diagram shows real instances

C The object diagram only shows methods

D The object diagram is used only for databases

B
Class diagrams show the general structure of the system, while object diagrams show the concrete objects and their relationships at a specific point in time.
 
 

4. What type of diagram is this model?


A Sequence diagram

B Use case diagram

C Activity diagram

D State diagram

C
This diagram represents the flow of actions, step by step, to order a product.
 

5. What does a stereotyped rectangle <<boundary>> represent in UML architecture?

A A hardware component

B A persistence class

C A design error

D An interface between the system and an external actor

D
The stereotype <<boundary>> represents a boundary class, often a user interface or an entry/exit point between the system and the outside (e.g., screen, API…). Example:
 
 

6. What error does this UML diagram contain?


A Missing attributes

B Incorrect notation for a method

C The class names are incorrect

D Nothing unusual

B
+speedUP : void should be written as +speedUP() : void, as in UML, a method must include parentheses even if it has no parameters.
 
 

7. What is the correct definition of a “secondary actor” in a use case diagram?

A The one who directly triggers a use case

B The one who is involved indirectly or in support

C The one who validates the results

D The one who connects to the interface

B
The secondary actor is not the primary initiator but participates in the use case (e.g., a payment system called by a user). Example:
 

The primary actor is a Customer who orders a product. The payment system is a secondary actor: it participates, but does not directly trigger the use case.
 

8. What is the purpose of a timing diagram in UML?

A To show the life cycles of objects

B To visualize the evolution of states over time

C To define user use cases

D To organize physical components

B
A timing diagram is a type of behavioral diagram used to show changes in an object’s state over time, often in a real-time context.
 

9. In a class diagram, which element contains attributes and operations?

A Object

B Class

C Use case

D Actor

B
A class contains attributes (data) and operations (methods) that define its behavior. Example:
 
 

10. What is the main difference between a class diagram and a component diagram?

A The class diagram shows the internal architecture of a system, while the component diagram shows its hardware deployment

B The class diagram describes the actions of the system, while the component diagram shows external actors

C The component diagram does not contain classes

D The class diagram is always more complex than a component diagram

A
A class diagram focuses on the internal structure (attributes and methods), while a component diagram shows how software components are deployed onto hardware.
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *