What is the difference between readonly and const
Answer Posted / chandan kumar
The read only keyword is different from the const keyword. A
const field can only be initialized at the declaration of
the field. A read only field can be initialized either at
the declaration or in a constructor. Therefore, read only
fields can have different values depending on the
constructor used. Also, while a const field is a
compile-time constant, the read only field can be used for
runtime constants as in the
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is sealed class in c#?
how to stored and retrive video in Sql server using asp.net c#......?
What is difference between .net and c#?
What is use of console?
If the original method is not static you can declare an override method to be static or not?
How long does it take to get a loop recorder put in?
What is CLR and its application.?
Is it possible to force garbage collector to run?
Name some properties of array.
What is difference between struct and class in c#?
Is c# and c same?
What is difference between constants and read-only?
Is static class thread safe in c#?
What is iqueryable and ienumerable in c#?
What is a function c#?