📜  哪些访问修饰符可用于类 - 无论代码示例

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

代码示例1
We can use only two access modifiers for class public and default.
public: A class with public modifier can be visible
1) In the same class
2) In the same package subclass
3) In the same package nonsubclass
4) In the different package subclass
5) In the different package non subclass.
default : A class with default modifier can be accesed
1) In the same class
2) In the same package subclass
3) In the same package nonsubclass
4) In the different package subclass
5) In the different package non subclass.