Since I'm new to OOPS concept,What if I write static public void instead of public static void in c sharp? Will that make any difference?
Since I'm new to OOPS concept,What if I write static public void instead of public static void in c sharp? Will that make any difference?
The C# language specification defines a method header in chapter 15.6.1 as
method-header: attributesopt method-modifiersopt partialopt return-type member-name type-parameter-listopt ( formal-parameter-listopt ) type-parameter-constraints-clausesopt
and
method-modifiers:
method-modifier
method-modifiers method-modifier
So the order is
[Something]) must go firstnew public protected internal private static virtual sealed override abstract extern) in any order (that's what you're asking about)partial must be before the return type<Something>) comes before parameterswhere clause lastIt won’t make any difference as long as your method name comes last and the return type of your method comes second last.
It's generally a best practice to put the access specifier (i.e public, private, protected) at the start
No, this is pure standard coding guidelines, the generated code will be exactly the same. The general guideline is to put the visibility keyword first.
I suggest you to use the StyleCop analyzer in order to be used to efficient, standard guidelines : https://github.com/DotNetAnalyzers/StyleCopAnalyzers