How can one create a package private class in a package?

0 votes
asked Aug 13, 2023 in Wanted features by anonymous
In some cases it is important to say that some class cannot be seen outside from a package. Itt seems that, those symbols (+,.,#,~) which works for methods and fields, do not work on classes. How can I say that a class is package private inside a package? If there is a solution, please, write a comment. If not, then this is a wanted feature.

1 Answer

0 votes
answered Jun 22, 2025 by The-Lu (89,080 points)

Hello A.,

See some answer's element here:

And:

@startuml
package P {
-class "private Class" {
}

#class "protected Class" {
}

~class "package private Class" {
}

+class "public Class" {
}
}
@enduml

Enjoy,
Regards,
Th.

...