What is the use of package level protection in java?

前端 未结 15 1097
时光说笑
时光说笑 2020-12-05 14:28

I know how package level protection in java works. I read a lot of code (including lots of open source stuff) and no-one seem to be using it. The whole protection l

15条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 14:37

    Mostly for Unit testing where source and test files are in the same package, tests can access the internals of the class without exposing it.

提交回复
热议问题