Exam 1z0-816 All QuestionsBrowse all questions from this exam
Question 11

Which two are successful examples of autoboxing? (Choose two.)

    Correct Answer: B, E

    Autoboxing in Java is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. Autoboxing works for Integer, Long, Double, etc., but not for classes like String. Therefore, assigning a primitive int value to an Integer object and a primitive long value to a Long object are successful examples of autoboxing. Thus, 'Integer e = 5;' and 'Long c = 23L;' are correct examples.

Discussion
y_kmboOptions: BE

Correct Answer: BE?