English

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?
Chapter 5: Primitive Values, Wrapper Classes, Types and Casting - EXERCISE [Page 112]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 5 Primitive Values, Wrapper Classes, Types and Casting
EXERCISE | Q 4. (a) | Page 112
Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 6 Variables and Expressions
EXERCISE | Q 4. | Page 131
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×