Java Quiz Day 31

Last Updated :
Discuss
Comments

Question 1

Which of the following is a wrapper class for int in Java?

  • A

    Integer

  • B

    Int

  • C

    WrapperInt

  • D

    Number

Question 2

What is autoboxing in Java?

  • A

    Converting wrapper to primitive

  • B

    Manually wrapping a primitive

  • C

    Automatically converting primitive to wrapper

  • D

    Compiling boxed objects

Question 3

Which of these is NOT a valid wrapper class in Java?

  • A

    Integer

  • B

    Float

  • C

    Long

  • D

    String

Question 4

What is the output of the following code?

Java
Integer a = 100;
int b = a;
System.out.println(b);


  • A

    0

  • B

    100

  • C

    Compilation error

  • D

    Runtime exception

Question 5

What is unboxing in Java?

  • A

    Wrapping primitive in object

  • B

    Converting object to class

  • C

    Converting wrapper to primitive

  • D

    Boxing a class

Question 6

Which of the following is true about wrapper classes?

  • A

    Wrapper classes allow primitives to be stored in collections


  • B

    Wrapper classes slow down performance

  • C

    Wrapper classes are used only in I/O

  • D

    Wrapper classes are deprecated

Tags:

There are 6 questions to complete.

Take a part in the ongoing discussion