Q8. What is an integer constant? Write integer forming rule of Java.
Ans. Integer literals are often referred to as integer constant. Integer literals are whole numbers without any fractional part. The method of writing integer constants has been specified in the following rule.
An integer constant must have at least one digit and must not contain any decimal point. It may contain either + or – sign. A number with no sign is assumed to be positive. Commas cannot appear in an integer constant.