Difference Between ReadOnly and Constant Variable in
compile time and Run Time.
Answers were Sorted based on User's Feedback
Answer / karna
I am adding another point to the above answer.
as the constant variable is constant over the class,that
means,all the objects created for that class have the same
value.
but in case of readonly variables,we can assign different
values in the different instances of the class it contains.
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / kamlesh sharma
readonly variables are can be initilized at compile time
but we can assign values to readonly varialble at once
through functions or constructors
but in case of constant variables once assign a value we
can't change value and must assign value to constant
variables at the time of declarition
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / saiish bhat
readonly is compile time constant.
constant is runtime constant.
constatnt field is used to initialize at the declaration of
the field.
readonly field is used at the declaration or constructor of
the field.
Is This Answer Correct ? | 0 Yes | 5 No |
How many languages are supported by .NET at present time?
write six HTTP request method?
Can you explain what inheritance is and give an example of when you might use it?
Is asp.net 64-bit enabled? How?
Explain the difference between inline and code behind - which is best in?
Explain how inline and code behind is used differently ?
What is the Global.asax used for?
what is view state?
Breifly explain about stack and heap memory Managemet?
Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
what is view state
5 Answers Microsoft, Siebel Systems,
Explain current thinking around IClonable.