Value Type Data Types
Definition:Value type data types are also called as Primitive data type or In-built data type.
Example:
int, float, char, boolean etc.
Discussion:
The data types that directly stores value (not reference) are called as value type data types.
They are called as primitive type data type because all other data types are derived from these primitive data types.
They are called as in-built data type because they are pre-defined or they come bundled with java.
Size and range:
byte | 1 byte | -128 to 127 |
short | 2 bytes | -32,768 to 32,767 |
int | 4 bytes | -2,147,483,648 to 2,147,483, 647 |
long | 8 bytes | -9,223,372,036,854,775,808 to 9223372036854770000 |
float | 4 bytes | approximately ±3.40282347E+38F |
double | 8 bytes | approximately ±1.79769313486231570E+308 |
char | 2 byte | 0 to 65,536 (unsigned) |
boolean | not precisely defined | true or false |
No comments:
Post a Comment