阅读背景:

嵌套类vs单独的类文件

来源:互联网 

In java at least, my compiler won't let me put two (or more) separate classes in a single class file. It forces me to create multiple files in the same package. I understand why this is, and I agree with this principle. However, I've realized that I could just as easily nest the classes and contain the entire program (excluding imported libraries) in a single file. I would imagine that this would be frowned upon, but I don't understand why. What are the dangers and disadvantages of nesting class as opposed to the standard system (outside of the severe loss in organization and neatness)?In java at least, my compiler won't let me put




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: