What is the difference between access specifiers and access modifiers?

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

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

相关标签:
10条回答
  • 2020-12-13 02:37

    According to me, yes, both terms refer to the same thing and are used interchangeably.

    0 讨论(0)
  • 2020-12-13 02:38

    That JDI reference is the only place I have ever seen the term 'access specifier' used in a Java specification. Even there, public/protected/private/package are also called 'modifiers'. There's really no reason to ever use the term 'access specifier' in Java, it is clearly just a mistake on one page out of many thousands.

    0 讨论(0)
  • 2020-12-13 02:45

    The term Access specifier used by c++ programmers not in java. In java Officially we use Access Modifier.

    For example: when we declare a class with private, static the compiler clearly shows the error message as follows:

    0 讨论(0)
  • 2020-12-13 02:46

    Referring to the Sun Java Docs they both seem to be the same:

    • Access Modifier
    • Search for access specifier on this page.
    0 讨论(0)
提交回复
热议问题