TechTips .NET/ CSLA.NET / ASP.NET / VB.NET / C# / SQL Server / MySql / Android
  • Jan
    17

    Difference between Const and Readonly

    Filed under: .NET, C#;


    So what is the difference between CONST and READONLY? Let’s examine the difference between these two with an example.


    So we can clearly see that we can initialize readonly variables during the declaration and in the constructor of the class. So its possible to initialize readonly variables once at run time but we can’t change value of const variables.

    Happy coding!

    7 Comments
 

7 responses to “Difference between Const and Readonly” RSS icon


Leave a reply

Translate

EnglishFrenchGermanHindiItalianPortugueseRussianSpanish
| More