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
How do switch statements work?
What is difference between virtual and override in c#?
Is datetime value type c#?
So let's say I have an application that uses myapp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name myapp.dll 1.1.0.0. How do I tell the client applications that are already installed to start using this new myapp.dll?
What’s a strong name?
Define delegation in .net?
Explain about CTS?
Why we use oops in c#?
What is deadly diamond problem?
What are strongly typed objects?
What are virtual classes in c#?
Why do we need static class in c#?
What is difference between dictionary and hashtable in c#?
Why do we use ienumerable in c#?
What is use of private class in c#?