A
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");
}
}
{
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");
}
}
- Correct Answer - Option(B)
- Views: 16
- Filed under category Java
- Hashtags:
Discusssion
Login to discuss.