Question:

Which of the following is not a visibility symbol?

Show Hint

Common UML visibility symbols are {+ (public), - (private), \# (protected), and $\sim$ (package)}.
  • *
  • $\sim$
  • \#
  • +
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Understanding visibility symbols in Object-Oriented Programming.
In Object-Oriented Programming (OOP) and particularly in UML class diagrams, visibility symbols are used to represent the accessibility of attributes and methods within a class. These symbols indicate whether a variable or method can be accessed from other classes or only within the same class.
Visibility symbols are an important concept in encapsulation, which is one of the fundamental principles of object-oriented programming.
Step 2: Common visibility symbols used in UML.
There are four common visibility indicators used in class diagrams:
+ (Public): Accessible from any other class.
- (Private): Accessible only within the same class.
\# (Protected): Accessible within the class and its subclasses.
$\sim$ (Package): Accessible within the same package.
Step 3: Evaluating the given options.
(A) * : Incorrect as a visibility symbol. The asterisk (*) is generally used in programming for multiplication or pointer representation but not as a visibility symbol in UML diagrams.
(B) $\sim$ : Correct visibility symbol representing package-level access.
(C) \# : Correct symbol representing protected visibility.
(D) + : Correct symbol representing public visibility.
Step 4: Conclusion.
Thus, the symbol that is not used as a visibility symbol in UML class diagrams is the asterisk (*).
Final Answer: *
Was this answer helpful?
0
0