Computer Science, asked by Shrieya, 10 months ago

What data type should be used to store value 22.23 in java so that it occupies minimum possible storage space retaining its real value?

Answers

Answered by shivaramdhanush
0

What data type should be used to store value 22.23 in java so that it occupies minimum possible storage space retaining its real value?

answer:

int or byte


Shrieya: But the no has decimal.
Shrieya: Wouldn't it be float data type ?
shivaramdhanush: yes it can be
shivaramdhanush: i didn't see the decimal
Shrieya: Ok
amannishad0512p5zxh6: Shreiya ji
amannishad0512p5zxh6: Waha pe
amannishad0512p5zxh6: double ya float hoga
Answered by amannishad0512p5zxh6
0

It can be float or double datatype.

But float is most appropriate as it occupies 4 bytes that is minimum possible storage value,while double occupies 8 bytes.

Hope it will help you.

Mark me brainlest.

If you like my answer.And follow me for more java doubts

Similar questions