What is the difference between Read-only and Const keyword?

Om ji mishra

Total Post:17

Points:119

Posted by  Om ji mishra
C#
 369  View(s)
Ratings:
Rate this:

What is the difference between Read-only and Const keyword?

  1. Re: What is the difference between Read-only and Const keyword?

    Read-Only

    Const          
    1.  Read-Only is a runtime constant. Const is a compile-time constant.
    2. The value of read-only can be changed. The value of const field cannot be changed
    3. It can't be declared inside the method. It can be declared inside the
    4. Read-only can be used static modifiers. Const can not be used with static modifiers.

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.