为什么我们不能将顶级类定义为私有类? [英] Why can't we define a top level class as private?
本文介绍了为什么我们不能将顶级类定义为私有类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么Java不允许将顶级类声明为私有?除了我们无法访问私人课程"之外,还有其他原因吗?
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"?
推荐答案
私有的顶级类将完全无用,因为没有人可以访问它.
A top-level class as private would be completely useless because nothing would have access to it.
这篇关于为什么我们不能将顶级类定义为私有类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文