What is the size of float and double in Java?

Java MCQ: What is the size of float and double in Java?

a) 32 and 64
b) 32 and 32
c) 64 and 64
d) 64 and 32

Answer:

a) 32 and 64

Explanation:

In Java, a float is a 32-bit IEEE 754 floating-point, and a double is a 64-bit IEEE 754 floating-point. Float has less precision than double, making it less suitable for precise calculations.

Reference links:

https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top