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
What are the boolean data types in c#?
Why are mutable structs evil?
Which programming language is best for desktop applications?
Is static thread safe?
What is the difference between array and list in c#?
Are c# strings immutable?
Explain namespaces in c#.
Explain About disco and uddi
What is xslt in c#?
What is meant by console programming?
Does a loop recorder have to be removed?
What is console writeline in c#?
What is a .aspx file?
What is the difference between const and readonly in c#.net?
What is the use of list in c#?