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.");
  • (A) FLOATs are not equal.
  • (B) FLOATs are equal.
  • (C) Compiler error
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (B) FLOATs are equal.

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
311
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
97%
Success Rate