What is the difference between readonly and const
Answer Posted / porchelvi.a
Constant:
--------
we have to initialize at the declaration itself
we could not change the value of constant variable.
Read only:
----------
we can not initialize the Read only variable during
declaration.we can initialize it in constructor only.after
that we could not change the value.Read noly is instance
based variable.
Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
why delegate is type safe?
What is equal c#?
What is dbml file in c#?
Explain the difference between object type and dynamic type variables in c#?
How much time will it take to learn unity?
What exception can an overridden method throw in comparison with the method it is overriding?
What is threading in c# with example?
Is a decimal an integer?
What is toint32 c#?
How does c# generics and c++ templates compare?
Any problem found in vs.et
What is the namespace for datatable in c#?
Are string objects mutable or immutable?
What is static and use of it?
What is difference between dynamic and var in c#?