12>>
1.

What are the differences between Boxing and Unboxing?


A) 'Boxing' is an implicit conversion of value type to reference type and 'Unboxing' is an explicit conversion of reference type to value type.

B) ‘Boxing’ is the process of converting a reference type to value type and ‘Unboxing’ is the process of converting value type to reference type

C) ‘Boxing’ is an explicit conversion and ‘Unboxing’ is an implicit conversion

D) Both ‘Boxing’ and ‘Unboxing’ we need implicit conversion



2.

What are the differences between reference type and value type?

1. Value types are stored in heap and reference type is derived from ‘System. ValueType’
2. Value type is derived from ‘System. ValueType’ and reference type is from Heap.
3. Structures, enumerated types derived from ‘System. ValueType’ are created on stack, hence known as ValueType and all ‘classes’ are reference type because values are stored on heap


A) 1, 3

B) 1, 2, 3

C) 2, 3

D) 1



3.

Select the output for the given set of programming code:

class Program
{
static void Main(string[] args)
{
int i;
for ( i = 0; i < 3; i++)
{

}
Console. WriteLine(i);
Console. ReadLine();
}
}


A) 0,1, 2, 3

B) 0, 1, 2

C) 2

D) 3



4.

Select the output for the given set of programming code:

static void Main(string[] args)
{
int i ;
for (i = 0; i <=2; i++)
{
int j = 0;
j += i;
Console. WriteLine(j);
}
Console. WriteLine( i * j);
Console. ReadLine();
}


A) Compile time error

B) 0, 2, 4

C) 4, 2, 0

D) 2, 0, 4



5.

Select the correct output for the following programming code

class Program
{
public static void Main(string[] args)
{
int i = 2;
for (a = 0; a < 2; a++)
{
int i = 2;
Console. WriteLine(a * i);
}
Console. ReadLine();
}
}


A) 0, 2

B) 0, 2, 4

C) 4, 2, 0

D) Compile time error



12>>