What is the meaning of public, protected, and private on class diagrams?
Asked
Active
Viewed 2,202 times
0
-
4Possible duplicate of [In Java, difference between default, public, protected, and private](http://stackoverflow.com/questions/215497/in-java-difference-between-default-public-protected-and-private) – EJoshuaS - Stand with Ukraine Aug 10 '16 at 15:42
1 Answers
1
These are access modifiers. See the below:
https://en.wikipedia.org/wiki/Access_modifiers
Basically, "public" means that the item in question is available to anyone who has access to the object, "protected" means that it's available to the object itself and any subclasses, and "private" means it can be accessed only within the class itself. Some languages also add additional keywords, such as "internal" in C# (which basically means that it's available to any class in the same namespace; usually you use this if there's some class you use internally to your DLL that you don't want other people to use).

EJoshuaS - Stand with Ukraine
- 11,977
- 56
- 49
- 78
-
1UML additionally defines package visibility in which case it means the feature is visible to all elements in the same package. – Ister Aug 10 '16 at 17:39