1.

What Is The Difference Between Constants And Read-only Variables That Are Used In Programs?

Answer»

Constants perform the same tasks as read-only variables with some DIFFERENCES. The differences between constants and read-only are

Constants:

  • Constants are DEALT with at compile-time.
  • Constants supports value-TYPE variables.
  • Constants should be used when it is very UNLIKELY that the value will ever change.

Read-only:

  • Read-only variables are evaluated at runtime.
  • Read-only variables can hold reference type variables.
  • Read-only variables should be used when run-time CALCULATION is required.

Constants perform the same tasks as read-only variables with some differences. The differences between constants and read-only are

Constants:

Read-only:



Discussion

No Comment Found