Timeline for What is the difference between const and readonly in C#?
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 3 at 15:08 | comment | added | B H | Could you get around this by making the constant private and creating a public static method on the class that just returns the constant value? I'm sure this is terrible etiquette to ask a question within the comments, but the question may also imply an answer. | |
Aug 19, 2016 at 13:02 | comment | added | springy76 | On decompilation (Reflector, ILSpy, ..) a constant NEVER EVER is referenced by any one, no matter of same assembly or another assembly, so you cannot analyze the usage of a constant in compiled code at all. | |
Apr 10, 2014 at 15:53 | history | edited | Appulus | CC BY-SA 3.0 |
Fixed grammar
|
Sep 11, 2008 at 8:15 | history | answered | aku | CC BY-SA 2.5 |