Hi,
Wish you all a happy new year 2014... I want to know the difference b/w modifier and specifier? Also what is static and void? Are they specifiers or modifiers?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Dec 31, 2013, 6:39 AM
Other keywords such as static, readonly, const and new are described simply as 'modifiers'.
AFAICS, the term 'specifier' is not used at all in the specification itself but you sometimes see it used in documentation etc. as another word for 'modifier'. So, in the context of C#, modifier and specifier mean the same thing though the former should be preferred.
'void' is technically a type (an alias for System.Void), see:
http://msdn.microsoft.com/en-us/library/system.void(v=vs.110).aspx
However, curiously, if you try to use System.Void in a C# application you get a compile time error.
Jaganathan BantheswaranPosted Dec 31, 2013, 6:13 AM
Access specifier specifies where a variable can be accessed from. For example public, private are specifiers because it says that a class can be accessed only within the class [incase of private] or outsite the class.
Access modifier specifies how variables should [not] be accessed. For example readonly, volatile are modifiers because it says that the variable can not be modified [incase od readonly].
[Updated]
Static is access modifier & void is a type.