πŸ“Š JAVA
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) Reading: 10

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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