What is the difference between access specifiers and access modifiers?

后端 未结 10 786
我在风中等你
我在风中等你 2020-12-13 02:02

In Java, are access specifiers and access modifiers the same thing?

10条回答
  •  忘掉有多难
    2020-12-13 02:21

    There is nothing known as "Access specifiers" in java, there are only Access modifiers in java

    The misconception is from languages like C++ where public, private, protected, default are considered as Access specifiers and remaining (static, final, etc) are considered as access modifiers

    Following is the proof as compiler says "modifier private not allowed here" i.e. compiler said modifier and not specifier

提交回复
热议问题