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
Explain the Abstract class in c#.net
Can int be null in c#?
What are sessions in c#?
What is the difference between add and addrange in c#?
What is the function of the not null constraint?
You are designing a user control. You created new property called backgroundimage which is of type image. You wanted to disable storing this property in the user’s form. How to achieve this?
What is dataset and dataadapter in c#?
What is using in c#?
What is public or shared assemblies ?
What does writeline mean?
What is difference between event and delegate in c#?
What is use of hashtable in c#?
How do I download a program to my desktop?
Whats an assembly? Describe the importance of assembly?
I want to print "Hello" even before main() is executed. How will you achieve that?