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
Define constructor in c#.
What is the difference between CreateObject() and GetObject()?
In c#, what will happen if you do not explicitly provide a constructor for a class?
What is the use of console?
Why is c# a good programming language?
Explain inheritance in c#?
What is difference between array and arraylist in c#?
Can You Prevent Your Class From Being Inherited By Another Class?
What are some of the commonly used commands in sqlcommand?
Differentiate between copy and default constructor.
What are primitive data types in c#?
Why to use “using” in c#?
What is int16?
Is a dll an assembly?
Are multiple data types stored in System.Array?