Tuesday, September 13, 2011

const

public const string FOO = "Bar";

 
 

...varies from...

public static string Foo = "Bar";

 
 

...in that a const is defined upon compilation. It is in memory immediately and one does not have to make one's way through code to the point where it is called to have it in memory.

No comments:

Post a Comment