Why can't we define a top level class as private?

前端 未结 10 2141
情书的邮戳
情书的邮戳 2020-12-07 12:38

Why does Java not allow a top level class to be declared as private? Is there any other reason other than \"We can\'t access a private class\"?

10条回答
  •  误落风尘
    2020-12-07 12:57

    A top-level class as private would be completely useless because nothing would have access to it.

提交回复
热议问题