English

Explain the int data type qualifiers with an Example.

Advertisements

Question

Explain the int data type qualifiers with an Example.

Explain
Advertisements

Solution

In Java, integer data type qualifiers refer to the different integer types used to store whole numbers of varying sizes and ranges. Java provides four integer data types: byte, short, int and long.

Example:

byte a = 10;
short b = 200;
int c = 5000;
long d = 100000L;

 In the above example, byte, short, int and long store integer values using different amounts of memory.

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. (b) | Page 112
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×