C# Constants

Constants (often referred to as literals) are data items that are fixed data values.

That means a constant is a value that cannot be changed throughout the program.

Kinds of Constants:

  1. integer-literals
  2. floating-literals
  3. Boolean-literals 
  4. character-literals
  5. string-literals
  6. the null literal

Note => The keyword ‘final‘ makes a variable as constant.

Syntax:

final data_type variable_name = value;

Example:

final double TAXRATE = 0.25;