What is the Difference between read only and constant
variables?
Answer Posted / kishore maddineni
all above answers are correct.But there is another point.
readonly variable can be assigned at declaration or at run
time which is must be in constructor. Readonly value can't
be modified.
Constant variable must be assigned at the time of
declaration only ,which is can't be modified.
| Is This Answer Correct ? | 36 Yes | 7 No |
Post New Answer View All Answers
i want the csharp questions&answeres
What is platform independence"?
Can a static class have a constructor c#?
Describe the ways of cleaning up objects in c#.
What is the diff between System.String and System.Text.StringBuilder classes?
What is an abstract class c#?
What is using keyword?
What is web forms in c#?
What is difference between dictionary and list in c#?
Can you inherit from a sealed class?
Can you inherit from multiple classes in c#?
Why do I get a syntax error when trying to declare a variable called checked?
Can you access a hidden base class method in the derived class?
What does firstordefault mean in c#?
Write one code example for compile time binding and one for run time binding? What is early/late binding?