WHAT IS THE DIFFERENCE BETWEEN CONST AND READONLY?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
C# 
C#
 1339  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What is the difference between CONST and READONLY?

    Both are meant for constant values. A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!