Today we learn about datatypes.
Datatypes are two types:
1.primetive datatypes
2.Non primitive datatypes
Primitive datatypes:
Java having 8 primitive datatypes.thats are:integer, float, char, boolean, long, double, byte, short.
1.integer:
An integer is a whole number that can be passitive, negative or zero.
It has 4 bytes of memory space and range=-2147483648 to 2147483647.
Float:
An float is represents decimal values. Ex:a=5.6
It has 4 bytes of memory space and range=±3.40282347E+38F .
Character:
An character is a single character that is letter, digit, space, a tab, punctuation mark.
It has 2 bytes of memory space and range=0 to 65,536 (unsigned).
Boolean:
An boolean is a true Or false value.
It Range is true Or false.
Long:
The long datatype a 64 bit two’ complement integer.
It has 8 bytes and range=-9,223,372,036,854,775,808 to9,223,372,036,854,775,807.
Double :
the double datatype is double precision 64-bit IEEE 754 floating point.
It has 8 bytes memory space.and range=±1.79769313486231570E+308.
Short:
The short datatype is a 16-bit signed two complement integer.
It has two bytes and range=-32,768 to 32,767.
Byte:
The byte datatype is an 8-bit signed two complement integer.
It has 1 byte memory space and range=-128 to 127.