Friday, August 6, 2010

primitive data types in JAVA

There is Eight primitive data types in the JAVA
boolean
one-bit. can take one value true and false only.

true and false are defined constants of the language and are not the same as True and False, TRUE and FALSE, zero and nonzero, 1 and 0 or any other numeric value. Booleans may not be cast into any other type of variable nor may any other variable be cast into a boolean.

byte
one byte .values from -128 to 127.

short
two bytes, -32,768 to 32,767

int
four bytes -2,147,483,648 to 2,147,483,647.

long
eight bytes Ranges from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807.

float
four bytes range from 1.40129846432481707e-45 to 3.40282346638528860e+38

double
eight bytes IEEE 754. range from 4.94065645841246544e-324d to 1.79769313486231570e+308d .
char
two bytes, 0 to 65,535 unicode

No comments:

Post a Comment