Integer constant (Definition)

A numeric value expressed as an integer.

An integer constant is a special case of the arithmetic constant. It's values must be integers - no decimal places.

It could be composed of several components if a constant expression is being created.

Integer constants can be defined as decimal, octal or hexadecimal values. Here are some examples:

With a little creativity in the scripting, you can assign string constants to the value of string objects, then decode the character value to yield an integer constant:

myString = new String("A");

myVariable = myString.charCodeAt(0);

See also:Arithmetic constant, Constant, Constant expression, Conversion, Decimal value, Hexadecimal value, Octal value, String.charCodeAt()