Home / Programming MCQs / JAVA MCQs / Question

R

Ram Sharma • 178.09K Points
Coach

Q. What is the output of the below java code with autoboxing?

Code:
public class AutoBoxingTest2
{
  static void show(int reading)
  {
    System.out.println("Reading: " + reading);
  }
  public static void main(String[] args)
  {
    Integer a = Integer.valueOf(10);
    show(a);
  }
}
(A) Reading: 0
(B) Reading: 10
(C) Compiler error
(D) Runtime Error

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.