+ 1
What is readonly variable?
c#
4 Answers
+ 4
Meaning that you cannot change the variable, its like a constant. You can only access it to read whatever the variable has.
+ 1
means you cant change it. you can only find out what its value is
+ 1
...is what i just said
+ 1
U can use readonly key word only on fields(variables).
U can assign values to readonly variable only on declaration or inside the same class constructor.
for more info: https://msdn.microsoft.com/en-us/library/acdd6hb7.aspx