A
Q. What is the output of the below Java code with Autoboxing and unboxing?
Code:
float f1 = 10.0f;
Float f2 = Float.valueOf(10);
if(f1 == f2)
System.out.println("FLOATs are equal.");
else
System.out.println("FLOATs are not equal.");
Float f2 = Float.valueOf(10);
if(f1 == f2)
System.out.println("FLOATs are equal.");
else
System.out.println("FLOATs are not equal.");
- Correct Answer - Option(B)
- Views: 4
- Filed under category Java
- Hashtags:
Discusssion
Login to discuss.