Computer Science, asked by rabi3bhat, 13 hours ago

If we write 100 integers to a file and 100 floats to another file. Which file will be larger?and Why?

Answers

Answered by shilpa85475
1

The float file will be larger than the 100 integers in the other file.

We know that the integer datatype size is 32 bits and float is also the same.

Explanation:

  • Integers and floats are two different kinds of numerical datatypes in Java.
  • An integer or a int is a number without a decimal point whereas a float is a floating-point number that has a decimal place. Floats are used mostly in certain data, where the uncertainties  needs to be covered.
  • The maximum value of Integer is 2.1 × 10^{9} and the floating datatype has the maximum size of 3.4 × 10^{38} .
  • Hence, the larger value of size is in float file.
Similar questions