Multiple choice

Which of the following is/are the false statement(s)?

  1. Unboxing can throw InvalidCastException at runtime.

  2. In boxing, a copy of the value type is taken from the heap to the stack.

  3. In unboxing, a copy of the value type is taken back from the heap to the stack.

  4. Casting does not physically move or operate on the object.

  5. Both (2) and (4).

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is false as boxing refers to take the value type from the stack to the heap.