Dive into C#, Web, Cloud, Network and Security

month May 2022

C# readonly vs const

The readonly and const keywords are sometimes used interchangeably in C#, to declare immutable fields in a class or a structure. Even though we use them to achieve the same purpose, there are noticeable differences between these two keywords.

© 2024 Siaka Baro

Up ↑