1)

Select the output for the following set of code:

public static void Main(string[] args)
{
int i = 200;
object o = i;
int n =(int) o;
o = 100;
System. Console. WriteLine("The value-type value = {0}", n);
System. Console. WriteLine("The object-type value = {0}", o);
Console. ReadLine();
}


A) 100, 200

B) 200, 100

C) 100, 100

D) 200, 200

Answer:

Option B

Explanation:


The concept of ‘unboxing’ is implemented here . To ‘unbox’ an object back to value type, we have to do it explicitly as “int n = (int) o”. So the output: 200, 100