Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

read only variable in c#

The readonly keyword can be used to define a variable or an object as readable only. This
means that the variable or object can be assigned a value at the class scope or in a
constructor only. You cannot change the value or reassign a value to a readonly variable or
object in any other method except the constructor.
 
PREVIOUS NEXT
Tagged: #read #variable
ADD COMMENT
Topic
Name
5+6 =