Advertisements

Aatul Palandurkar

Data Types in Java

Posted on: October 17, 2011

In Java there are total 8 data types available which are further divided into 4 groups viz. integers, floating point numbers, character & boolean values.

Type

Size in Bytes (Bits)

Range

Default value

Contains

Integers
Byte 1 byte (8 bits) -128 to 127 0 Signed Integer
Short 2 bytes

(16 bits)

-32768 to 32767 0 Signed Integer
Int 4 bytes

(32 bits)

-2147483648 to 2147483647 0 Signed Integer
Long 8 bytes

(64 bits)

-9223372036854775808 to 9223372036854775807 0 Signed Integer
Floating point numbers
Float 4 bytes

(32 bits)

-3.4e38 to 3.4e38

(i.e. 3.4*1017)

0.0 IEEE754 Floating point number
Double 8 bytes

(64 bits)

-1.7e308 to 1.7e308

(i.e. 1.7*10151)

0.0 IEEE754 Floating point number
Characters
char 2 bytes

(16 bits)

\u0000 to \uFFFF \u0000 Unicode Characters
Boolean values
boolean 1 bit Not Applicable False true or false

Table : Data Types in Java

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Advertisements

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 8,304 other followers

Tweets

%d bloggers like this: