The diagram fragment shows an instance specification for anEmployee. The different prefixes before each attribute indicate the visibility of that attribute:
+Public: Visible to everyone.
-Private: Visible only within the defining class.
#Protected: Visible to subclasses and package.
~Package: Visible to all classes within the same package.
Given these visibility indicators, the attribute with the private visibility is-salary: Real. This means that thesalaryattribute is the one that is hidden outside of thecurrent:Employeeclassifier and cannot be accessed by entities that do not belong to theEmployeeclass.
Therefore, the correct answer is:
C. salary
[Reference: Object Management Group (OMG) Unified Modeling Language (UML) Specification Version 2.5.1 Section 7.4 on Properties, specifically visibility of properties., ]
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit