When to use readonly in C#

Subscribers:
5,420
Published on ● Video Link: https://www.youtube.com/watch?v=nPYE-wPkTIY



Duration: 0:44
2,070 views
6


The readonly keyword is a modifier that you can use on fields. When a field declaration includes a readonly modifier, assignments to the fields introduced by the declaration can only occur as part of the declaration or in a constructor in the same class.







Tags:
Readonly
csharp
C#
const
constant
read-only
keyword