This quick test should show why:
public class Main { public static void main(String[] args) { System.out.println("Float: " + Float.MAX_VALUE); System.out.println("Long: " + Long.MAX_VALUE); } }
Ouput:
Float: 3.4028235E38 Long: 9223372036854775807
Pay attention to the scientific notation in the Float line. Float takes up less space, but due to its presentation, it can hold up to a larger number than Long.
Carcigenicate
source share