Which data type is used to store floating-point numbers with single precision in Java?
A. float
B. double
C. decimal
D. real
Answer: Option A
Solution(By Examveda Team)
The correct answer is Option A: float.In Java, the float data type is used to store floating-point numbers with single precision.
Here's the breakdown:
Option A: float - This is the correct data type for single-precision floating-point numbers in Java.
Option B: double - This data type is used for double-precision floating-point numbers, which can store numbers with greater precision compared to float.
Option C: decimal - There is no decimal data type in Java for floating-point numbers.
Option D: real - There is no real data type in Java for floating-point numbers.
So, the correct choice for single-precision floating-point numbers in Java is float.
Related Questions on Data Types and Variables
What is the maximum value that can be stored in a byte variable in Java?
A. 127
B. 255
C. 32767
D. 64
What is the default value of an int variable in Java if it's not explicitly initialized?
A. 0
B. 1
C. -1
D. Null
Which of the following is not a valid identifier for a Java variable?
A. my_var
B. _myVar
C. 3rdVar
D. $var
Join The Discussion