Read-only and constants variables

Distinguish between read-only and constants variables which is used in the programs?

E

Expert

Verified

Constants carry out same tasks as read-only variables with some differences.

The differences between the constants and read-only are:

Constants:

a) It supports value-type variables.
b) Constants are dealt with at the compile-time.
c) Constants can be used whenever it is very doubtful that the value will ever change.

Read-only:

a) Read-only variables are evaluated at runtime.
b) Read-only variables must be used when the run-time calculation is required.
c) Read-only variables can hold the reference type variables.

   Related Questions in DOT NET Programming

©TutorsGlobe All rights reserved 2022-2023.