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 is tpl in c#?
What is the default scope of a class in c#?
What is tochararray in c#?
How to handle exceptions that are raised in a component?
List down the reason behind the usage of c# language.
how to stored and retrive video in Sql server using asp.net c#......?
What is stringbuilder c#?
Explain About .NET Framework
What is the use of the dispose method in C# ?
How does one compare strings in c#?
How many types of inheritance are there in c#?
If you want to write your own dot net language, what steps you will u take care?
What is different about switch statements in c#?
Why do we use abstraction in c#?
What is difference between Trace and Debug