Data Types in Java

There are 8 primitive data types available in Java language as given below.

  1. byte
  2. short
  3. int
  4. long
  5. float
  6. double
  7. char
  8. boolean

            All the above data type are divided into four groups as given below :-

  • Integer

 

Data Type No. of bytes                        Range
byte 1 -128 to 127
short 2 -32768 to 32767
int 4 -2147483648 to 2147483647
long 8   -9223372036854775808 to 9223372036854775807

 

  • Floating

 

Data Type No. of bytes                        Range
float 4 -3.4 e 38 to 3.4e 38
double 8 -1.7e  308 to 1.7 e 308

  • Character
Data Type No. of bytes Range
char 2 0 to 65535

char data type of java always follows the UNI ( Universal code ) range.

  • Boolean
Data Type No. of bytes Range
boolean 1 true or false

Leave a Reply

Your email address will not be published. Required fields are marked *