According to Eric “a type in C# is a mathematical entity that obeys certain algebraic rules”.
Now the question is what is “public” keyword in c# (besides the usage that public is a keyword used on class , field and delegate by which there accessibility for outside world is defined as accessible) ?
Similar questions can go like what is “var” key word , is it a type in c# of some type?
If they are type then what algebraic rules do they follow ?
EDIT : May be this question is misinterpreted and I got ban on posting the question.
Looking forward for someone to lift the ban.
I was confused when I read “Everything is type in any language”
Thanks.
publicis really just an access modifier used, as you already know, on classes, fields etc.The
varkeyword on the other hand is a shortcut for “whatever type the statement on the right returns”. This is really just compiler candy, as it will be resolved to a concrete type (e.g.Int32) during compilation.EDIT: If you are interested in what is a type and what is not, then you might want to have a look at http://msdn.microsoft.com/en-us/library/3ewxz6et.aspx. It will answer the first part of the question explicitly.