Answer Posted / xiaof
A const field can only be initialized at the declaration of
the field. A readonly field can be initialized either at
the declaration or in a constructor. Therefore, readonly
fields can have different values depending on the
constructor used. Also, while a const field is a compile-
time constant, the readonly field can be used for runtime
constants as in the following example:
public static readonly uint l1 = (uint) DateTime.Now.Ticks;
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the use of tuple in c#?
If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?
How can we sort an array in c#?
3. Use layered architecture for coding. s.no name description 1 abc xxxxxxxxx 2 abc xxxxxxxxx 3 4 5 6 7 8 Select all Clear all Add Delete Name Description Save close
Could you explain the difference between func vs action vs predicate?
what is c# command?
What is inheritance c#?
Please explain value types and reference types used in c#?
Can we inherit abstract class in c#?
Which config file has all the supported channels/protocol?
What will be the output of the following code?
What is inumerable?
What are the Configuration files in .net?
how to create crystal reports give one detail example(i want to view age category report) please give suitable example in my small knowledge
What is property c#?