Exactly the same?

public static void function() static public void function() 
+6
c #
source share
5 answers

Yes. They are the same.

By convention, people usually add an access modifier first. However, this does not affect the generated IL, which ends as:

.method public hidebysig static void function () cil managed

+18
source share

Yes, they are essentially the same, but Microsoft has moved the access modifier first.

See below for more details.

+7
source share

Right. However, Microsoft recommends using a specific style for writing code. You can download StyleCop to check your code style. I would use "public static".

+4
source share

The order of public and static has nothing to do with the compiler, although this can make a difference to anyone who supports the code. The standard must first introduce an access modifier.

+3
source share

UP ... They are the same. it is like calling names or a person for example: Mark John or John Mark =)

0
source share

All Articles