If we write 100 integers to a file and 100 floats to another file. Which file will be larger?and Why?
Answers
Answered by
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 × and the floating datatype has the maximum size of 3.4 × .
- Hence, the larger value of size is in float file.
Similar questions
English,
7 hours ago
History,
13 hours ago
Math,
13 hours ago
Computer Science,
8 months ago
Science,
8 months ago