Explain the int Data Type with an Example.
Advertisements
Questions
Explain the int Data Type with an Example.
Explain the int data typе.
Explain
Advertisements
Solution
The int data type is a primitive data type in Java that is used to store whole numbers without decimal points. It is a 32-bit signed integer data type that occupies 4 bytes of memory. It can store both positive and negative integer values ranging from −2,147,483,648 to 2,147,483,647.
Example:
int age = 18;
In the above example, int specifies the integer data type, age is the variable name, and 18 is the integer value assigned to the variable.
shaalaa.com
Is there an error in this question or solution?
