Loading

Q1.

Which of the following is a wrapper class in Java?

A. int

B. Integer

C. string

D. character


Q2.

What is Autoboxing in Java?

A. Converting object into primitive

B. Converting primitive into object automatically

C. Manual conversion of primitive into object

D. None of the above


Q3.

Which statement about wrapper classes is true?

A. Wrapper classes are mutable

B. Wrapper classes can hold only primitive values, not null

C. Wrapper classes are immutable

D. Wrapper classes are faster than primitives


Q4.

What happens if you try to unbox a null wrapper object?

A. It gives 0 or default value

B. It gives compile-time error

C. It throws NullPointerException

D. It works normally


Q5.

Which package contains all wrapper classes in Java?

A. java.io

B. java.util

C. java.lang

D. java.wrapper