Readonly vs. const?
Answers were Sorted based on User's Feedback
Answer / pavan
both of them does the same work these value cannot be
changed
but with a samll difference
using const we can assign a value before compile time
but using readonly we can assign value to the varible ones
in runtime
| Is This Answer Correct ? | 14 Yes | 0 No |
Answer / j_baghla
Both are used for constant values but in readonly variable
we can assign the value thru expression but we can't assign
value to constant variable thru expression.
| Is This Answer Correct ? | 5 Yes | 1 No |
Can "this" be used within a static method?
What is the intermediate language between asp and asp.net1.0?
why you wouldn't want to write into it even if you could
How will you make .NET programs work in Linux ?
What is managed code in .NET?
what is assembly?
How viewstate is being formed and how it's stored on client in .net?
Is .net core stable?
What is gac in .net?
How inheritance works in .net?
What versions of .net are there?
what is use of learning .net? does we get good jobs based on .net?