A

Admin • 828.03K Points
Coach

Q. What is the output of the below Java code snippet that use Autoboxing and Unboxing?

Code:
public class AutoUnboxingTest1
{
public static void main(String[] args)
{
int apple1 = 10;
Integer apple2 = 10;
if(apple1 == apple2)
System.out.println("apple1=apple2");
else
System.out.println("apple1!=apple2");
}
}
  • (A) apple1!=apple2
  • (B) apple1=apple2
  • (C) Compiler error
  • (D) None of these
  • Correct Answer - Option(B)
  • Views: 16
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.