UML MCQ

UML Diagrams MCQs Questions With Answers – Part 28

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. What does a connector link in a UML composite structure diagram?

A Two inherited classes

B Two packages

C Two ports or internal parts of the same component

D Two lifelines in a sequence

C
In a composite structure diagram, connectors are used to link ports, parts, or interfaces inside a component. This defines the internal architecture of a class/component. Example:
 
 

2. In typed UML profiles (like UML for JEE), what does the stereotype <<entity>> refer to?

A A basic abstract class

B A user interface

C A persistent business class

D A DAO implementation class

C
The <<entity>> stereotype identifies a business class that is persisted in a database, often used in frameworks like JPA or Hibernate. It contains logic related to business data.
 

3. What does the arrow Book –> Author mean?


A Author can access Book

B Book has a navigable access to Author

C Book inherits from Author

D It’s a composition from Book to Author

B
The simple arrow (–>) in UML means that the Book object knows or can navigate to the Author object, but not necessarily the other way around.
 
 

4. What does “number” represent here?


A A method parameter

B A temporary attribute

C A visibility constraint

D A qualification key allowing access to an Account via its number

D
In UML, a qualified association links a class to another by adding a unique access key, such as an identifier.
 

5. What is the characteristic of an internal transition in a UML state?

A It changes the state of the object

B It triggers no behavior

C It is invisible to the user

D It does not cause exit or entry into the current state

D
In a UML state diagram, an internal transition is a reaction to an event that occurs inside a state, without causing a state change. It is shown within the state body, not with an arrow like regular transitions. When triggered, only the associated action is executed, without calling the exit or entry actions. For example, in a Playing state of an audio player, an internal transition on event volume+ might trigger the action increaseVolume() while remaining in the Playing state.
 

6. Which statement is true regarding an interface in UML?

A It can contain state attributes

B It can be instantiated directly

C It can be inherited by another interface

D It cannot be associated with a class

C
In UML (as in Java/C#), an interface can inherit from another interface, allowing the creation of a hierarchy of abstract behaviors. It cannot contain state or be instantiated. Example:
 
 
 

7. What does the ..|> relationship mean?


A Video inherits from an abstract class

B Video is a subclass of Recordable

C Video implements the Recordable interface

D Recordable instantiates Video

C
The dashed arrow ..|> indicates that the class implements an interface, as opposed to a solid arrow, which means class inheritance.
 

8. In a UML activity diagram, how is the passing of an object from one activity to another represented?

A By an object node linked to actions

B By a floating text annotation

C By a diamond between two arrows

D By a line with a box named object

A
Objects transmitted in the flow are represented by object nodes, connected to actions. They show which objects are produced or consumed by activities.
 

9. The multiplicity 0..* means that ___________

A The element is mandatory and unique

B There are between 1 and 5 elements

C Zero or any number of elements

D Exactly one element

C
The notation 0..* indicates an optional and multiple relationship: there may be none or many elements (unbounded). Ex: a Cart may contain 0..* products.
 
 

10. You are designing a fitness app. A training program is composed of multiple sessions, which do not exist on their own. What UML relationship?

A Dependency

B Composition

C Association

D Aggregation

B
The sessions are part of the program and do not exist without it → strong composition.
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 *