Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are the following exactly same?

Tags:

c#

.net

public static void function()
static public void function()
like image 703
user496949 Avatar asked Nov 26 '10 01:11

user496949


People also ask

Is it correct to say exactly the same?

In casual speech we often say things like, “The fruitcake he gave me was the exact same one I'd given him last Christmas,” but in formal English the phrase is “exactly the same.”

Is it exact same or same exact?

"Exact same" tells the reader or listener that you mean same in its most literal sense and do not mean that the two things are simply very similar but are exact. Ultimately, whether exact in "exact same" is a redundant adjective or an idiomatic adverb is of secondary importance.

Why we use the with same?

We can use same as an adjective before a noun or as a pronoun. When we use same to compare people or things, we must use it with the: I noticed that Richard and I were both wearing the same jacket.


2 Answers

Yes. They are the same.

By convention, people usually put the access modifier first. However it has no effect on the generated IL which both end up as:

.method public hidebysig static void function() cil managed

like image 148
Richard Anthony Freeman-Hein Avatar answered Oct 24 '22 04:10

Richard Anthony Freeman-Hein


Yes they are essentially the same, however Microsoft perfers the access modifier to come first.

See the following post for more detail.

like image 24
JonVD Avatar answered Oct 24 '22 04:10

JonVD