Java Primitive data types

There is two types in java programming language .The First is primitive and the second is object reference.

I will explain here the primitive data types :


1 )
Data Type : boolean
Size in Byte : 1 byte
Size in Bits : 8bits
Values: True or False
Wrapper: java.lang.Boolean

2 )
Data Type :
byte
Size in Byte :
1byte
Size in Bits :
8bits
Values: signed integer
-128 to 127.
Wrapper:java.lang.Byte

Java Data types

3 )
Data Type :char
Size in Byte : 2bytes
Size in Bits : 16bits
Values: unicode character  0 to 65,535
Wrapper: java.lang.Character

4 )
Data Type : integer
Size in Byte : 4bytes
Size in Bits : 32bits
Values: signed /unsigned integer  .
Wrapper:java.lang.Integer

2,147,483,648  to  2,147,483,647

5)
Data Type : short
Size in Byte : 2bytes
Size in Bits : 16bits
Values: signed/unsigned integer
Wrapper: java.lang.Short

-32,768 to 32,767

6)
Data Type : long
Size in Byte : 8bytes
Size in Bits : 64bits
Values: signed /unsigned integer
Wrapper: java.lang.Long

-9,223,372,036,854,775,808  to  +9,223,372,036,854,775,807.

7)
Data Type : float
Size in Byte : 4bytes
Size in Bits : 32bits
Values: Real number /Floating point
Wrapper:java.lang.Float

1.40129846432481707e-45 to 3.40282346638528860e+38

8 )
Data Type : double
Size in Byte : 8bytes
Size in Bits : 64bits
Values: Real number /Floating point
Wrapper:java.lang.Double

4.94065645841246544e-324d to 1.79769313486231570e+308d

Share

About the Author

Akash Padhiyar

Visit Website

There are no comments yet, add one below.

Leave a Comment

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

*

Time limit is exhausted. Please reload CAPTCHA.