LearnFrenzy
Sign in Take a free test

Object Class and Wrapper Classes · Object and Wrapper Classes MCQ · Question 10

What autoboxing calls Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 10 Back to Exercise

What does the compiler turn Integer x = 42; into?

  • A new Integer(42)
  • B Integer.valueOf(42) Correct
  • C Integer.parseInt("42")
  • D (Integer) 42.0
Correct Answer: Option B

valueOf may return a cached object; new Integer is deprecated for removal.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links