曹凯 发表于 2013-8-16 15:08:11

[Oracle interview]Can a top level class be private or protected?

于军 发表于 2013-8-16 15:25:19

No. A toplevel class can not be private or protected. It can have either"public" or no modifier. If it does not have a modifier it issupposed to have a default access.If a top level class is declared as privatethe compiler will complain that the "modifier private is not allowedhere". This means that a top level class can not be private. Same is thecase with protected.
页: [1]
查看完整版本: [Oracle interview]Can a top level class be private or protected?