What is double and float values in Java and What makes it different from int and float type ?
basically I want to know about the double and long type in Java how does they work and and when to use them instead of int and float .
What is double and float values in Java and What makes it different from int and float type ?
basically I want to know about the double and long type in Java how does they work and and when to use them instead of int and float .
int is 4 bytes, long is 8 bytes. The range of possible numbers is bigger from long to int.
Same goes for double and float, but with decimals.
See MIN_VALUE and MAX_VALUE field on the wrapper classes java.lang.Integer, java.lang.Long, java.lang.Float and java.lang.Double.