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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Dec 31, 2013, 1:13 AM EST
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.
VulpesRank #55 · 29.2K reputationPosted Dec 31, 2013, 1:39 AM EST
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.