In my program, I have several class variables whose access specifier is known as private package.
The default accessor specifier in Java is known as private package where it is accessible within the package which the class belongs to.
For the UML class diagram , should I label these variables as public or private? I can’t decide because of this concept of private package.
2
If the tool you use for drawing the UML diagrams doesn’t provide the (language specific) access specifier that you need, you can still draw a useful class diagram.
The easiest way is just to leave out all the access specifiers. This doesn’t mean that everything is now public, but rather that the diagram doesn’t tell you if the members are public, private, package private or something else.
If you do want to show access specifiers, you also could label the package private members as protected members. While technically incorrect, protected access is the closest in meaning to package private access and is usually used only very little, so you could just add a note to your diagram that the protected access specifier should be read as package private.