Answer Posted / vathsala
A quick synopsis on the differences between 'const'
and 'readonly' in C#:
'const':
1.Can't be static.
2.Value is evaluated at compile time.
3.Initiailized at declaration only.
'readonly':
1.Can be either instance-level or static.
2.Value is evaluated at run time.
3.Can be initialized in declaration or by code in the
constructor.
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What do you mean by saying a "struct is a value type"?
What are the Configuration files in .net?
Name some properties of thread class.
What is option parameter in C#?
What is the and operator in c#?
how encapsulation is implemented in c#
Can dictionary have duplicate keys c#?
Explain partial class in c#?
Explain About namespaces
Can enum have methods c#?
What is the difference between array and arraylist c#?
What is the components of window?
Does c# do array bounds checking?
Can we customize the serialization process?
Difference between StackPanel and RelativePanel ?