What is the Difference between read only and constant
variables?
Answer Posted / parmjit
We can assign a value to a readonly variable at runtime
till it is a unassined identifier, but once value is
assigned, it cannot be changed.
In case of const we cannot assign a value at run time i.e.
the value assigned to it at declaration time cannot be
change
| Is This Answer Correct ? | 39 Yes | 3 No |
Post New Answer View All Answers
Does c# have functions?
What is a static class in c#?
Why do we need a singleton class?
What is class in oops with example in c#?
Can we have two main methods in c#?
In languages without exception-handling facilities, we could send an error-handling procedure as a parameter to each procedure that can detect errors that must be handled. What disadvantages are there to this method?
Are arrays value types or reference types?
What does void do in c#?
How many parameters can a method have c#?
We cannot create instances of static classes. Can we have constructors for static classes?
What are types in c#?
what is the difference between convert.tostring() and tostring() functions ?
What is static class in C#?
Define Virtual folder?
How are delegates chosen?