Data types:

Data types are used for identifying and assessing type of data of real world value.
Java have data types which allows developer to select right type of data as per real world requirement.
Every variable in Java has a data type which tells the compiler what type of variable it as and what type of data it is going to store.
Data type specifies the size and type of values.

Types of data type:

1) Primitive data types
2) Non-primitive data types – Arrays and Strings are non-primitive data types.

Primitive data types

Eight primitive data types: boolean, char, byte, short, int, long, float and double.

byte, short, int and long data types -----> for storing whole numbers.
float and double--------------------------> for fractional numbers.
char---------------------------------------> for storing characters.
boolean ----------------------------------->for holding either true or false in variables


Default size : 1 byte.


Its range is -32,768 to 32767.
Default size : 2 byte


Its range: -2,147,483,648 to 2,147,483,647.
Default size: 4 byte


Its range : -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
size: 8 bytes


Its holding--> 15 decimal number
size: 8 bytes


Its holding -->6 to 7 decimal number
size: 4 bytes


It holds either true of false.


It holds letters.

size: 2 bytes


Plot number-56/1
Near Gurudwara
LandMark :
Opposite A.N.D college
Govindpuri Metro station
New Delhi
Mobile number: