Multiple choice

Which of the following is/are the example of boxing in C#?

  1. object o=255;int x= (int)o;

  2. int x=255;object o=x;

  3. int i = 255;object o = i;i = Convert.ToInt32(o);

  4. both (2) and (3).

  5. none of the above

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

Yes, both are the example of boxing.