C# .NET - difference between access specifiers and access modifiers in c#?

Asked By Eswaran Radhakrishnan on 19-Apr-10 02:32 AM

Hi all,
I am writing this for learning point of view,
What is the difference between access specifiers and access modifiers in c#?
If both are different means give an example for better understanding...

thanks
r.eswaran.

Anand Malli replied to Eswaran Radhakrishnan on 19-Apr-10 02:37 AM
Hi Eswaran

see the following

Access specifiers
------------------------
  
1) The access specifier determines how accessible the field is 
to code in other classes. Access ranges from totally 
accessible to totally inaccessible. You can optionally 
declare a field with an access specifier keyword: public, 
private, or protected.
  
2) private, or protected.
  
2) it will define scope
  
Access Modifiers
-----------------------
  
1) You can optionally declare a field with a modifier keyword: 
final or volatile and/or static and/or transient.
  
2) private,  protected or default.
  
3) It defines the behaviour


thxs
Sagar P replied to Eswaran Radhakrishnan on 19-Apr-10 02:39 AM
Access specifiers ::

The access specifier determines how accessible the field is to code in other classes. Access ranges from totally accessible to totally inaccessible. You can optionally declare a field with an access specifier keyword: public, private, or protected.

Access Modifiers ::

You can optionally declare a field with a modifier keyword: final or volatile and/or static and/or transient

Access Specifier are used to specifiy how the member variable ,methods or class to other classes.They are public ,private and protected.

Access Modifier:
1.Access
2.Non Access

Access:
public ,private,protected and default.

Non Access:
abstract,final,native,static,synchronized,transient,volatile
and strictfp

Anoop S replied to Eswaran Radhakrishnan on 19-Apr-10 03:04 AM
Access Specifiers
-----------------
They are used to set the visibility of a class or variable or a method.
ex:public,private,protected and default.

Access Modifiers
-----------------
They are used to optionally declare a field with a modifier keyword:
final or volatile or static or transient or abstract or native