📜  顶级类允许的所有访问修饰符 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:19.198000             🧑  作者: Mango

代码示例1
For top level class only two access modifiers are allowed. 
public and default. If a class is declared as public it is visible everywhere.
If a class is declared default it is visible only in same package.
If we try to give private and protected as access modifier to class 
we get the below compilation error.
Illegal Modifier for the class only public,abstract and final are permitted.