Difference between Access Specifier and Access Modifier

I read on the internet and I heard people talking

Access Specifiers ::

An access specifier defines how an accessible field is code in other classes. Access range from fully accessible to completely inaccessible. You can optionally declare the access field the keyword specifier: public, private, or protected.

Access Modifiers ::

You can optionally declare a field with the modifier keyword: final or unstable and / or static and / or temporary, abstract, etc.

Is there any difference at all? Because most definitions for access modifiers and access specifiers indicate the same thing. It seems so ambiguous.

+5
source share
5 answers

In this context, you can consider access specifiers as security specifiers - they determine which variable can be accessed. In contrast, access modifiers are completely different; they indicate how variables should (or should not) be available; e.g. read-only, mutable, etc.

ie, a variable can be publicly available, but read-only, or it can be private and writable - access specifiers have nothing to do with modifiers.

, , #, Microsoft public private " ", volatile readonly " ".

+6

, . MS ++, , .

+2

MSDN # 4.0, , - . # " ", , .

.

, , , . , . , .

( ), , . , , , , , , readonly - .

PS. #, VB.NET, Java, public private. , ++ .

(# 4.0)

Visual Basic (VB.NET 2010)

(Java)

(++ 2010)

+2

, /.

. , .

+1

, .

0

All Articles