• A constant is a static field whose value can never change.
  • A constant can be any of the built-in numeric types, bool, char, string, or an enum type.
  • A constant is declared with the const keyword and must be initialized with a value.
  • Constants can also be declared local to a method.
public class Test
public const string Message = "Hello World";

Non-local constants modifiers:

Access modifiers: public internal private protected
Inheritance modifier: new

Leave a Reply

Your email address will not be published. Required fields are marked *