A) we have 8 primitive data types in java language.
1) int – 4 bytes
2)float
3)double
4)char
5)Boolean
6)short - 2 bytes
7)byte – 1 bytes
8)long – 8 bytes
Int , short , byte , long are non decimal integer values.
-> float and double represent decimal data types.“float“ is single precision and “double” is double precision(after decimal how many no . of values are there is called precision)
Ex :
float a=2.123456789f ;
Outout is 2.1234567 . because after decimal the float taken 7 degits are taken
Ex :
double a=2.123456789123456789 ;
Output is 2.1234567891234567
Comments
Post a Comment