A constant is a value that cannot be modified after it is assigned. Constants can be divided into two broad categories:
Literal constants are numbers (integers and floats), single characters, or character strings.
Named constants are created using the const qualifier and must be initialized at the time of declaration.
These variables are typically given identifiers that are in all uppercase letters to help signify that they are read-only. You should use the const statement in cases where you would use the #define statement in C++.
The static keyword tells the compiler that the value of the variable will never be destroyed and a single instance is always stored. These variables are initialized to zero by default.
The following examples demonstrate using constant and static values.