Академический Документы
Профессиональный Документы
Культура Документы
1. Which of the following statements are correct about the C#.NET code snippet given
below?
2. Which of the following statements are correct about the C#.NET code snippet given
below?
5. How will you complete the foreach loop in the C#.NET code snippet given below
such that it correctly prints all elements of the array a?
6. Which of the following is the correct output of the C#.NET code snippet given
below?
7. Which of the following statements are correct about arrays used in C#.NET?
8. Which of the following statements are correct about the C#.NET code snippet given
below?
9. Which of the following are the correct ways to define an array of 2 rows and 3
columns?
1. int[ , ] a;
2. a = new int[2, 3]{{7, 1, 3},{2, 9, 6}};
3.
4. int[ , ] a;
5. a = new int[2, 3]{};
6.
7. int[ , ] a = {{7, 1, 3}, {2, 9,6 }};
8.
9. int[ , ] a;
10. a = new int[1, 2];
11.
12. int[ , ] a;
13. a = new int[1, 2]{{7, 1, 3}, {2, 9, 6}};
Which of the following statements is correct about the array declaration given
below?
int[][][] intMyArr = new int[2][][];
A.intMyArr refers to a 2-D jagged array containing 2 rows.
B. intMyArr refers to a 2-D jagged array containing 3 rows.
C.intMyArr refers to a 3-D jagged array containing 2 2-D jagged arrays.
D.intMyArr refers to a 3-D jagged array containing three 2-D jagged arrays.
E. intMyArr refers to a 3-D jagged array containing 2 2-D rectangular arrays.
11. Which of the following statements is correct about the C#.NET code snippet
given below?
12. Which of the following is the correct way to define and initialise an array of 4
integers?
int[] a;
a = new int[3];
a[0] = 25;
a[1] = 30;
a[2] = 40;
a[3] = 5;
int[] a;
a = new int{25, 30, 40, 5};
int[] a;
a = new int[4]{25, 30, 40, 5};
int[] a;
a = new int[4];
a[0] = 25;
a[1] = 30;
a[2] = 40;
a[3] = 5;
13. Which of the following is the correct output of the C#.NET code snippet given
below?
14. Which of the following is the correct way to obtain the number of elements
present in the array given below?
1. intMyArr.GetMax;
2. intMyArr.Highest(0);
3. intMyArr.GetUpperBound(0);
4. intMyArr.Length;
5. intMyArr.GetMaxElements(0);
15. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
int i, j;
int[ , ] arr = new int[ 2, 2 ];
for(i = 0; i < 2; ++i)
{
for(j = 0; j < 2; ++j)
{
arr[i, j] = i * 17 + i * 17;
Console.Write(arr[ i, j ] + " ");
}
}
}
}
}
A.0 0 34 34
B. 0 0 17 17
C. 0 0 0 0
D.17 17 0 0
E. 34 34 0 0
.Net Framework
1. Which of the following statements are TRUE about the .NET CLR?
4. Which of the following utilities can be used to compile managed assemblies into
processor-specific native code?
A.gacutil B. ngen
C. sn D.dumpbin
E. ildasm
1. ASP.NET Applications
2. CLR
3. Framework Class Library
4. WinForm Applications
5. Windows Services
11. Which of the following assemblies can be stored in Global Assembly Cache?
A.Private Assemblies
B. Friend Assemblies
C.Shared Assemblies
D.Public Assemblies
E. Protected Assemblies
13. Which of the following statements is correct about the .NET Framework?
A..NET Framework uses DCOM for achieving language interoperability.
B. .NET Framework is built on the DCOM technology.
.NET Framework uses DCOM for making transition between managed and
C.
unmanaged code.
D..NET Framework uses DCOM for creating unmanaged applications.
E. .NET Framework uses COM+ services while creating Distributed Applications.
14. Which of the following is the root of the .NET type hierarchy?
A.System.Object
B. System.Type
C. System.Base
D.System.Parent
E. System.Root
15. Which of the following benefits do we get on running managed code under
CLR?
16. Which of the following security features can .NET applications avail?
1. PIN Security
2. Code Access Security
3. Role Based Security
4. Authentication Security
5. Biorhythm Security
17. Which of the following jobs are done by Common Language Runtime?
1. Which of the following statements is correct about the C#.NET code snippet given
below?
2. Which of the following statements is correct about the C#.NET code snippet given
below?
class Sample
{
private int i;
public Single j;
private void DisplayData()
{
Console.WriteLine(i + " " + j);
}
public void ShowData()
{
Console.WriteLine(i + " " + j);
}
}
A.j cannot be declared as public.
B. DisplayData() cannot be declared as private.
C. DisplayData() cannot access j.
D.ShowData() cannot access to i.
E. There is no error in this class.
5. Which of the following is the correct way to create an object of the class Sample?
Which of the following will be the correct output for the C#.NET program given
below?
namespace IndiabixConsoleApplication
{
class Sample
{
int i;
Single j;
public void SetData(int i, Single j)
{
i = i;
j = j;
///assignment to same variable means…means assign something else…
}
public void Display()
{
Console.WriteLine(i + " " + j);
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
s1.SetData(10, 5.4f);
s1.Display();
}
}
}
A.0 0
B. 10 5.4
C. 10 5.400000
D.10 5
E. None of the above
7. The this reference gets created when a member function (non-shared) of a class is
called.
A.True B.False
9. Which of the following statements is correct about the C#.NET code snippet given
below?
namespace IndiabixConsoleApplication
{
class Sample
{
public int index;
public int[] arr = new int[10];
class MyProgram
{
static void Main(string[] args)
{
Sample s = new Sample();
s.index = 20;
Sample.fun(1, 5);
s.fun(1, 5);
}
}
}
A.s.index = 20 will report an error since index is public.
B. The call s.fun(1, 5) will work correctly.
C. Sample.fun(1, 5) will set a value 5 in arr[ 1 ].
D.The call Sample.fun(1, 5) cannot work since fun() is not a shared function.
E. arr being a data member, we cannot declare it as public.
10. Which of the following statements are correct about the C#.NET code snippet given
below?
sample c;
c = new sample();
11. Which of the following statements is correct about the C#.NET code snippet given
below?
int i;
int j = new int();
i = 10;
j = 20;
String str;
str = i.ToString();
str = j.ToString();
A.This is a perfectly workable code snippet.
B. Since int is a primitive, we cannot use new with it.
C. Since an int is a primitive, we cannot call the method ToString() using it.
D.i will get created on stack, whereas j will get created on heap.
E. Both i and j will get created on heap.
12. Which of the following statements are correct about the this reference?
Which of the following will be the correct output for the C#.NET program given
below?
namespace IndiabixConsoleApplication
{
class Sample
{
int i;
Single j;
public void SetData(int i, Single j)
{
this.i = i;
this.j = j;
}
public void Display()
{
Console.WriteLine(i + " " + j);
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
s1.SetData(36, 5.4f);
s1.Display();
}
}
}
A.0 0.0
B. 36 5.4
C. 36 5.400000
D.36 5
E. None of the above
14. Which of the following statements are correct about objects of a user-defined class
called Sample?
1. All objects of Sample class will always have exactly same data.
2. Objects of Sample class may have same or different data.
3. Whether objects of Sample class will have same or different data depends upon a
Project Setting made in Visual Studio.NET.
4. Conceptually, each object of Sample class will have instance data and instance
member functions of the Sample class.
5. All objects of Sample class will share one copy of member functions.
15. Which of the following statements are correct about the C#.NET code snippet given
below?
namespace IndiabixConsoleApplication
{
class Sample
{
int i, j;
public void SetData(int ii, int jj)
{
this.i = ii;
this.j = jj
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
s1.SetData(10, 2);
Sample s2 = new Sample();
s2.SetData(5, 10);
}
}
}
A.The code will not compile since we cannot explicitly use this.
B. Using this in this program is necessary to properly set the values in the object.
C. The call to SetData() is wrong since we have not explicitly passed the this reference to it.
The definition of SetData() is wrong since we have not explicitly collected the this
D.
reference.
E. Contents of this will be different during each call to SetData().
16. Which of the following statements is correct about classes and objects in
C#.NET?
A.Class is a value type.
B. Since objects are typically big in size, they are created on the stack.
C. Objects of smaller size are created on the heap.
D.Smaller objects that get created on the stack can be given names.
E. Objects are always nameless.
Constructor
2. Which of the following statements is correct about the C#.NET code snippet given
below?
namespace IndiabixConsoleApplication
{
class Sample
{
public int func()
{
return 1;
}
public Single func()
{
return 2.4f ;
}
}
class Program
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
int i;
i = s1.func();
Single j;
j = s1.func();
}
}
}
A.func() is a valid overloaded function.
B. Overloading works only in case of subroutines and not in case of functions.
func() cannot be considered overloaded because: return value cannot be used to
C.
distinguish between two overloaded functions.
D.The call to i = s1.func() will assign 1 to i.
E. The call j = s1.func() will assign 2.4 to j.
3. Which of the following ways to create an object of the Sample class given below
will work correctly?
class Sample
{
int i;
Single j;
double k;
public Sample (int ii, Single jj, double kk)
{
i = ii;
j = jj;
k = kk;
}
}
A.Sample s1 = new Sample();
B. Sample s1 = new Sample(10);
C. Sample s2 = new Sample(10, 1.2f);
D.Sample s3 = new Sample(10, 1.2f, 2.4);
E. Sample s1 = new Sample(, , 2.5);
6. Which of the following is the correct way to define the constructor(s) of the
Sample class if we are to create objects as per the C#.NET code snippet given
below?
public Sample()
{
i = 0;
j = 0.0f;
}
A.public Sample (int ii, Single jj)
{
i = ii;
j = jj;
}
D.Sample s;
s = new Sample();
E.
7. In which of the following should the methods of a class differ if they are to be
treated as overloaded methods?
1. Type of arguments
2. Return type of methods
3. Number of arguments
4. Names of methods
5. Order of arguments
10. How many times can a constructor be called during lifetime of the object?
A.As many times as we call it.
B. Only once.
C. Depends upon a Project Setting made in Visual Studio.NET.
D.Any number of times before the object gets garbage collected.
E. Any number of times before the object is deleted.
14. Is it possible for you to prevent an object from being created by using zero
argument constructor?
A.Yes B.No
15. Which of the following statements are correct about static functions?
A.Static functions are invoked using objects of a class.
B. Static functions can access static data as well as instance data.
C. Static functions are outside the class scope.
D.Static functions are invoked using class.
16. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class Sample
{
static Sample()
{
Console.Write("Sample class ");
}
public static void Bix1()
{
Console.Write("Bix1 method ");
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample.Bix1();
}
}
}
A.Sample class Bix1 method
B. Bix1 method
C. Sample class
D.Bix1 method Sample class
E. Sample class Sample class
18. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class Sample
{
public static void fun1()
{
Console.WriteLine("Bix1 method");
}
public void fun2()
{
fun1();
Console.WriteLine("Bix2 method");
}
public void fun2(int i)
{
Console.WriteLine(i);
fun2();
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample s = new Sample();
Sample.fun1();
s.fun2(123);
}
}
}
Bix1 method
123
Bixl method
A.
Bix2 method
Bix1 method
123
B. Bix2 method
Bix2 method
123
C. Bix2 method
Bixl method
Bixl method
D.123
Bix2 method
E. 123
Bixl method
Strings
1. Which of the following statements are true about the C#.NET code snippet given
below?
2. Which of the following will be the correct output for the C#.NET code snippet
given below?
A.ARE B. CRE
C. CR D.REA
E. CREATED
3. Which of the following statements will correctly copy the contents of one string
into another ?
String s1 = "String";
String s2;
A.
s2 = s1;
String s1 = "String" ;
String s2;
B.
s2 = String.Concat(s1, s2);
String s1 = "String";
String s2;
C.
s2 = String.Copy(s1);
String s1 = "String";
String s2;
D.
s2 = s1.Replace();
String s1 = "String";
E. String s2;
s2 = s2.StringCopy(s1);
The string built using the String class are immutable (unchangeable), whereas, the
ones built- using the StringBuilder class are mutable.
A.True B.False
5. Which of the following will be the correct output for the C#.NET code snippet
given below?
String s1 = "Nagpur";
String s2;
s2 = s1.Insert(6, "Mumbai");
Console.WriteLine(s2);
A.NagpuMumbair
B. Nagpur Mumbai
C. Mumbai
D.Nagpur
E. NagpurMumbai
6. If s1 and s2 are references to two strings, then which of the following is the
correct way to compare the two references?
A.s1 is s2
B. s1 = s2
C. s1 == s2
D.strcmp(s1, s2)
E. s1.Equals(s2)
7. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
string str= "Hello World!";
Console.WriteLine( String.Compare(str, "Hello World?" ).GetType() );
}
}
}
A.0
B. 1
C. String
D.Hello World?
E. System.Int32
8. Which of the following snippets are the correct way to convert a Single into a String?
1 Single f = 9.8f;
String s;
s = (String) (f);
2 Single f = 9.8f;
String s;
s = Convert.ToString(f);
3 Single f = 9.8f;
String s;
s = f.ToString();
4 Single f = 9.8f;
String s;
s = Clnt(f);
5 Single f = 9.8f;
String s;
s = CString(f);
9. Which of the following will be the correct output for the C#.NET code snippet given
below?
String s1="Kicit";
Console.Write(s1.IndexOf('c') + " ");
Console.Write(s1.Length);
A.3 6
B. 2 5
C. 3 5
D.2 6
E. 3 7
1 String s = "123";
int i;
i = (int)s;
2 String s = "123";
int i;
i = int.Parse(s);
3 String s = "123";
int i;
i = Int32.Parse(s);
4 String s = "123";
int i;
i = Convert.ToInt32(s);
5 String s = "123";
int i;
i = CInt(s);
13. Which of the following will be the correct output for the C#.NET code snippet
given below?
A.0 B. 1
C. 2 D.-1
E. -2
14. If s1 and s2 are references to two strings then which of the following are the correct
ways to find whether the contents of the two strings are equal?
1. if(s1 = s2)
2. if(s1 == s2)
3. int c;
c = s1.CompareTo(s2);
5 if (s1 is s2)
15. Which of the following statements are correct about the String Class in C#.NET?
17. Which of the following is the correct way to find out the index of the second 's'
in the string "She sells sea shells on the sea-shore"?
String str = "She sells sea shells on the sea-shore";
Aint i;
. i = str.SecondIndexOf("s");
1. true
2. false
3. +
4. new
5. is
3. Which of the following keyword is used to change the data and behavior of a base
class by replacing a member of a base class with a new derived member?
A.new
B. base
C. overloads
D.override
E. overridable
9. Which of the following statement is correct about the C#.NET code snippet given
below?
1. true
2. false
3. new
4. ~
5. sizeof
12. Which of the following modifier is used when a virtual method is redefined by a
derived class?
A.overloads
B. override
C. overridable
D.virtual
Base
E.
13.In order for an instance of a derived class to completely take over a class
member from a base class, the base class has to declare that member as
A.new
B. base
C.virtual
D.overrides
E. overloads
14. Which of the following can be declared as a virtual in a class?
1. Methods
2. Properties
3. Events
4. Fields
5. Static fields
int i = 0, j = 0;
label:
i++;
j+=i;
if (i < 10)
{
Console.Write(i +" ");
goto label;
}
A.Prints 1 to 9
B. Prints 0 to 8
C. Prints 2 to 8
D.Prints 2 to 9
E. Compile error at label:.
2. Which of the following is the correct output for the C#.NET program given
below?
int i = 20 ;
for( ; ; )
{
Console.Write(i + " ");
if (i >= -10)
i -= 4;
else
break;
}
A.20 16 12 84 0 -4 -8
B. 20 16 12 8 4 0
C. 20 16 12 8 4 0 -4 -8 -12
D.16 12 8 4 0
E. 16 8 0 -8
namespace IndiabixConsoleApplication
{
public enum color
{ red, green, blue };
class SampleProgram
{
static void Main (string[ ] args)
{
color c = color.blue;
switch (c)
{
case color.red:
Console.WriteLine(color.red);
break;
case color.green:
Console.WriteLine(color.green);
break;
case color.blue:
Console.WriteLine(color.blue);
break;
}
}
}
}
A.red B. blue
C. 0 D.1
E. 2
5. Which of the following is the correct way to rewrite the following C#.NET code
snippet given below?
int i = 0;
do
{
Console.WriteLine(i);
i+ = 1;
} while (i <= 10);
.
int i = 0;
do
{
Console.WriteLine(i);
} until (i <= 10);
int i;
for (i = 0; i <= 10 ; i++)
Console.WriteLine(i);
int i = 0;
while (i <= 11)
{
Console.WriteLine(i);
i += 1;
}
int i = 0;
do while ( i <= 10)
{
Console.WriteLine(i);
i += 1;
}
int i = 0;
do until (i <= 10)
{
Console.WriteLine(i);
i+=1;
}
6. What will be the output of the C#.NET code snippet given below?
int val;
for (val = -5; val <= 5; val++)
{
switch (val)
{
case 0:
Console.Write ("India");
break;
}
if (val > 0)
Console.Write ("B");
else if (val < 0)
Console.Write ("X");
}
A.XXXXXIndia B. IndiaBBBBB
C. XXXXXIndiaBBBBB D.BBBBBIndiaXXXXX
E. Zero
7. What will be the output of the C#.NET code snippet given below?
case 'B':
case 'b':
Console.WriteLine ("case B | case b");
break;
case 'C':
case 'c':
case 'D':
case 'd':
Console.WriteLine ("case D | case d");
break;
}
A.case A | case a
B. case B | case b
C. case D | case d
D.Compile Error
E. No output
9. Which of the following code snippets are the correct way to determine whether a
is Odd or Even?
int a;
String res;
if (a % 2 == 0)
res = "Even";
else
res = "Odd";
int a;
String res;
if (a Mod 2 == 0)
res = "Even";
else
res = "Odd";
int a;
Console.WriteLine(a Mod 2 == 0 ? "Even": "Odd");
int a;
String res;
a % 2 == 0 ? res = "Even" : res = "Odd";
Console.WriteLine(res);
10. Which of the following can be used to terminate a while loop and transfer
control outside the loop?
1. exit while
2. continue
3. exit statement
4. break
5. goto
11. The C#.NET code snippet given below generates ____ numbers series as output?
int i = 1, j = 1, val;
while (i < 25)
{
Console.Write(j + " ");
val = i + j;
j = i;
i = val;
}
A.Prime B. Fibonacci
C. Palindrome D.Odd
E. Even
12. Which of the following statements are correct about the C#.NET code snippet given
below?
1. The condition no < 11 will be evaluated only if age > 18 evaluates to True.
2. The statement a = 25 will get executed if any one condition is True.
3. The condition no < 11 will be evaluated only if age > 18 evaluates to False.
4. The statement a = 25 will get executed if both the conditions are True.
5. && is known as a short circuiting logical operator.
int i = 2, j = i;
if (Convert.ToBoolean((i | j & 5) & (j - 25 * 1)))
Console.WriteLine(1);
else
Console.WriteLine(0);
A.0
B. 1
C. Compile Error
D.Run time Error
15. Which of the following statements is correct about the C#.NET code snippet
given below?
switch (id)
{
case 6:
grp = "Grp B";
break;
case 13:
grp = "Grp D";
break;
case 1:
grp = "Grp A";
break;
case ls > 20:
grp = "Grp E";
break ;
case Else:
grp = "Grp F";
break;
}
A.Compiler will report an error in case ls > 20 as well as in case Else.
B. There is no error in this switch case statement.
C. Compiler will report an error only in case Else.
D.Compiler will report an error as there is no default case.
E. The order of the first three cases should be case 1, case 6, case 13 (ascending).
16. Which of the following is another way to rewrite the code snippet given below?
int a = 1, b = 2, c = 0;
if (a < b) c = a;
int a = 1, b = 2, c = 0;
A.
c = a < b ? a : 0;
int a = 1, b = 2, c = 0;
B. a < b ? c = a : c = 0;
int a = 1, b = 2, c = 0;
C. a < b ? c = a : c = 0 ? 0 : 0;
int a = 1, b = 2, c = 0;
D.a < b ? return (c): return (0);
int a = 1, b = 2,c = 0;
E.
c = a < b : a ? 0;
1. The switch statement is a control statement that handles multiple selections and
enumerations by passing control to one of the case statements within its body.
2. The goto statement passes control to the next iteration of the enclosing iteration
statement in which it appears.
3. Branching is performed using jump statements which cause an immediate
transfer of the program control.
4. A common use of continue is to transfer control to a specific switch-case label or the
default label in a switch statement.
5. The do statement executes a statement or a block of statements enclosed in {}
repeatedly until a specified expression evaluates to false.
18. Which of the following statements are correct about the C#.NET code snippet given
below?
1. The condition no < 11 will get evaluated only if age > 18 evaluates to False.
2. The condition no < 11 will get evaluated if age > 18 evaluates to True.
3. The statement a = 25 will get evaluated if any one one of the two conditions is
True.
4. || is known as a short circuiting logical operator.
5. The statement a = 25 will get evaluated only if both the conditions are True.
19. What will be the output of the code snippet given below?
int i;
for(i = 0; i<=10; i++)
{
if(i == 4)
{
Console.Write(i + " "); continue;
}
else if (i != 4)
Console.Write(i + " "); else
break;
}
A.1 2 3 4 5 6 7 8 9 10
B. 1 2 3 4
C. 0 1 2 3 4 5 6 7 8 9 10
D.4 5 6 7 8 9 10
E. 4
20. Which of the following loop correctly prints the elements of the array?
do
{
A. Console.WriteLine((char) i);
}
while (int i = 0; i < arr; i++);
do
{
E. Console.WriteLine((char) i);
}
until (int i = 0; i < arr; i++);
21. Which of the following statements is correct about the C#.NET code snippet
given below?
case j:
Console.WriteLine("I am in Case j");
break;
}
The compiler will report case i and case j as errors since variables cannot be
A.
used in cases.
Compiler will report an error since there is no default case in the switch case
B.
statement.
C. The code snippet prints the result as "I am in Case i"".
D.The code snippet prints the result as "I am in Case j".
E. There is no error in the code snippet.
Operator
1. Which of the following are the correct ways to increment the value of variable a by 1?
1. ++a++;
2. a += 1;
3. a ++ 1;
4. a = a +1;
5. a = +1;
2. What will be the output of the C#.NET code snippet given below?
byte b1 = 0xF7;
byte b2 = 0xAB;
byte temp;
temp = (byte)(b1 & b2);
Console.Write (temp + " ");
temp = (byte)(b1^b2);
Console.WriteLine(temp);
A.163 92
B. 92 163
C. 192 63
D.0 1
1. >=
2. !=
3. Not
4. <=
5. <>=
6. Which of the following statements is correct about the C#.NET code snippet given
below?
int d;
d = Convert.ToInt32( !(30 < 20) );
A.A value 0 will be assigned to d.
B. A value 1 will be assigned to d.
C. A value -1 will be assigned to d.
D.The code reports an error.
E. The code snippet will work correctly if ! is replaced by Not.
7. Which of the following is the correct output for the C#.NET code snippet given below?
1. &&
2. ||
3. !
4. Xor
5. %
10. Suppose n is a variable of the type Byte and we wish, to check whether its fourth
bit (from right) is ON or OFF. Which of the following statements will do this
correctly?
11. What will be the output of the C#.NET code snippet given below?
int num = 1, z = 5;
12. Suppose n is a variable of the type Byte and we wish to put OFF its fourth bit
(from right) without disturbing any other bits. Which of the following statements
will do this correctly?
A.n = n && HF7
B. n = n & 16
C.n = n & 0xF7
D.n = n & HexF7
E. n = n & 8
13. What will be the output of the C#.NET code snippet given below?
byte b1 = 0xAB;
byte b2 = 0x99;
byte temp;
temp = (byte)~b2;
Console.Write(temp + " ");
temp = (byte)(b1 << b2);
Console.Write (temp + " ");
temp = (byte) (b2 >> 2);
Console.WriteLine(temp);
A.102 1 38
B. 108 0 32
C.102 0 38
D.1 0 1
14. Which of the following statements is correct about Bitwise | operator used in
C#.NET?
A.The | operator can be used to put OFF a bit.
B. The | operator can be used to Invert a bit.
C. The | operator can be used to check whether a bit is ON.
D.The | operator can be used to check whether a bit is OFF.
E. The | operator can be used to put ON a bit.
16. What will be the output of the C#.NET code snippet given below?
int i, j = 1, k;
for (i = 0; i < 5; i++)
{
k = j++ + ++j;
Console.Write(k + " ");
}
A.8 4 16 12 20
B. 4 8 12 16 20
C. 4 8 16 32 64
D.2 4 6 8 10
17. What will be the output of the C#.NET code snippet given below?
18. Which of the following statements are correct about the following code snippet?
int a = 10;
int b = 20;
bool c;
c = !(a > b);
19. Which of the following statements is correct about Bitwise ^ operator used in C#.NET?
A.The ^ operator can be used to put ON a bit.
B. The ^ operator can be used to put OFF a bit.
C. The ^ operator can be used to Invert a bit.
D.The ^ operator can be used to check whether a bit is ON.
E. The ^ operator can be used to check whether a bit is OFF.
1. The conditional operator (?:) returns one of two values depending on the
value of a Boolean expression.
2. The as operator in C#.NET is used to perform conversions between
compatible reference types.
3. The &* operator is also used to declare pointer types and to dereference
pointers.
4. The -> operator combines pointer dereferencing and member access.
5. In addition to being used to specify the order of operations in an expression,
brackets [ ] are used to specify casts or type conversions.
1. Which of the following will be the correct output for the C#.NET program given
below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[] args)
{
int num = 1;
funcv(num);
Console.Write(num + ", ");
funcr(ref num);
Console.Write(num + ", ");
}
static void funcv(int num)
{
num = num + 10; Console.Write(num + ", ");
}
static void funcr (ref int num)
{
num = num + 10; Console.Write(num + ", ");
}
}
}
A.1, 1, 1, 1,
B. 11, 1, 11, 11,
C. 11, 11, 11, 11,
D.11, 11, 21, 11,
E. 11, 11, 21, 21,
2. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[] args)
{
int[]arr = newint[]{ 1, 2, 3, 4, 5 };
fun(ref arr);
}
static void fun(ref int[] a)
{
for (int i = 0; i < a.Length; i++)
{
a[i] = a[i] * 5;
Console.Write(a[ i ] + " ");
}
}
}
}
A.1 2 3 4 5
B. 6 7 8 9 10
C. 5 10 15 20 25
D.5 25 125 625 3125
E. 6 12 18 24 30
5. Which of the following statements are correct about functions and subroutines
used in C#.NET?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[] args)
{
int a = 5;
int s = 0, c = 0;
Proc(a, ref s, ref c);
Console.WriteLine(s + " " + c);
}
static void Proc(int x, ref int ss, ref int cc)
{
ss = x * x;
cc = x * x * x;
}
}
}
A.0 0
B. 25 25
C. 125 125
D.25 125
E. None of the above
7. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
int i = 10;
double d = 34.340;
fun(i);
fun(d);
}
static void fun(double d)
{
Console.WriteLine(d + " ");
}
}
}
A.10.000000 34.340000
B. 10 34
C. 10 34.340
D.10 34.34
Which of the following statements are correct?
10. If a function fun() is to receive an int, a Single & a double and it is to return a
decimal then which of the following is the correct way of defining this function?
11. Which of the following statements are correct about functions used in C#.NET?
13. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
object[] o = new object[] {"1", 4.0, "India", 'B'};
fun (o);
}
static void fun (params object[] obj)
{
for (int i = 0; i < obj.Length-1; i++)
Console.Write(obj[i] + " ");
}
}
}
A.1 4.0 India B
B. 1 4.0 India
C.1 4 India
D.1 India B
15. Which of the following CANNOT occur multiple number of times in a program?
A.namespace B. Entrypoint
C. Class D.Function
E. Subroutine
16. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
int i;
int res = fun(out i);
Console.WriteLine(res);
}
static int fun (out int i)
{
int s = 1;
i = 7;
for(int j = 1; j <= i; j++)
{
s = s * j;
}
return s;
}
}
}
A.1 B. 7
C. 8 D.720
E. 5040
17. If a function fun() is to sometimes receive an int and sometimes a double then
which of the following is the correct way of defining this function?
static void fun(object i)
A.
{ ... }
static void fun(int i)
B.
{ ... }
static void fun(double i, int j)
C.
{ ... }
static void fun(int i, double j)
D.
{ ... }
E. static void fun(int i, double j, )
18. Which of the following statements are correct about subroutines used in C#.NET?
20. Which of the following statements are correct about the C#.NET program given
below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
int a = 5;
int s = 0, c = 0;
s, c = fun(a);
Console.WriteLine(s +" " + c) ;
}
static int fun(int x)
{
int ss, cc;
ss = x * x; cc = x * x * x;
return ss, cc;
}
}
}
21. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
int i = 5;
int j;
fun1(ref i);
fun2(out j);
Console.WriteLine(i + ", " + j);
}
static void funl(ref int x)
{
x = x * x;
}
static void fun2(out int x)
{
x = 6;
x = x * x;
}
}
}
A.5, 6
B. 5, 36
C. 25, 36
D.25, 0
E. 5, 0
Inheritance
2. Which of the following statements should be added to the subroutine fun( ) if the
C#.NET code snippet given below is to output 9 13?
class BaseClass
{
protected int i = 13;
}
class Derived: BaseClass
{
int i = 9;
public void fun()
{
// [*** Add statement here ***]
}
}
A.Console.WriteLine(base.i + " " + i);
B. Console.WriteLine(i + " " + base.i);
C. Console.WriteLine(mybase.i + " " + i);
D.Console.WriteLine(i + " " + mybase.i);
E. Console.WriteLine(i + " " + this.i);
3. Which of the following statements are correct about the C#.NET code snippet given
below?
namespace IndiabixConsoleApplication
{
class index
{
protected int count;
public index()
{
count = 0;
}
}
class index1: index
{
public void increment()
{
count = count +1;
}
}
class MyProgram
{
static void Main(string[] args)
{
index1 i = new index1();
i.increment();
}
}
}
namespace IndiabixConsoleApplication
{
class Baseclass
{
private int i;
protected int j;
public int k;
}
class Derived: Baseclass
{
private int x;
protected int y;
public int z;
}
class MyProgram
{
static void Main (string[ ] args)
{
Derived d = new Derived();
}
}
}
A.24 bytes
B. 12 bytes
C. 20 bytes
D.10 bytes
E. 16 bytes
5. Which statement will you add in the function fun() of class B, if it is to produce
the output "Welcome to IndiaBIX.com!"?
namespace IndiabixConsoleApplication
{
class A
{
public void fun()
{
Console.Write("Welcome");
}
}
class B: A
{
public void fun()
{
// [*** Add statement here ***]
Console.WriteLine(" to IndiaBIX.com!");
}
}
class MyProgram
{
static void Main (string[ ] args)
{
B b = new B();
b.fun();
}
}
}
A.base.fun();
B. A::fun();
C. fun();
D.mybase.fun();
E. A.fun();
6. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class Baseclass
{
public void fun()
{
Console.Write("Base class" + " ");
}
}
class Derived1: Baseclass
{
new void fun()
{
Console.Write("Derived1 class" + " ");
}
}
class Derived2: Derived1
{
new void fun()
{
Console.Write("Derived2 class" + " ");
}
}
class Program
{
public static void Main(string[ ] args)
{
Derived2 d = new Derived2();
d.fun();
}
}
}
A.Base class
B. Derived1 class
C. Derived2 class
D.Base class Derived1 class
E. Base class Derived1 class Derived2 class
8. Which of the following is correct about the C#.NET snippet given below?
namespace IndiabixConsoleApplication
{
class Baseclass
{
public void fun()
{
Console.WriteLine("Hi" + " ");
}
public void fun(int i)
{
Console.Write("Hello" + " ");
}
}
class Derived: Baseclass
{
public void fun()
{
Console.Write("Bye" + " ");
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Derived d;
d = new Derived();
d.fun();
d.fun(77);
}
}
}
A.The program gives the output as: Hi Hello Bye
B. The program gives the output as: Bye Hello
C. The program gives the output as: Hi Bye Hello
D.Error in the program
1. static
2. protected
3. private
4. shared
5. public
1. Inheritance
2. Encapsulation
3. Templates
4. Containership
5. Polymorphism
Which of the following should be used to implement a 'Like a' or a 'Kind of'
relationship between two entities?
A.Polymorphism B. Containership
C. Templates D.Encapsulation
E. Inheritance
13. Which of the following statements are correct about Inheritance in C#.NET?
14. Assume class B is inherited from class A. Which of the following statements is
correct about construction of an object of class B?
While creating the object firstly the constructor of class B will be called followed
A.
by constructor of class A.
While creating the object firstly the constructor of class A will be called
B.
followed by constructor of class B.
C. The constructor of only class B will be called.
D.The constructor of only class A will be called.
The order of calling constructors depends upon whether constructors in class A and
E.
class B are private or public.
15. Which of the following statements is correct about the C#.NET program given
below?
namespace IndiabixConsoleApplication
{
class Baseclass
{
int i;
public Baseclass(int ii)
{
i = ii;
Console.Write("Base ");
}
}
class Derived : Baseclass
{
public Derived(int ii) : base(ii)
{
Console.Write("Derived ");
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Derived d = new Derived(10);
}
}
}
The program will work correctly only if we implement zero-argument constructors
A.
in Baseclass as well as Derived class.
B. The program will output: Derived Base
C. The program will report an error in the statement base(ii).
D.The program will work correctly if we replace base(ii) with base.Baseclass(ii).
E. The program will output: Base Derived
Properties
1. A property can be declared inside a class, struct, Interface.
A.True B.False
3. A Student class has a property called rollNo and stu is a reference to a Student
object and we want the statement stu.RollNo = 28 to fail. Which of the following
options will ensure this functionality?
A.Declare rollNo property with both get and set accessors.
B. Declare rollNo property with only set accessor.
C. Declare rollNo property with get, set and normal accessors.
D.Declare rollNo property with only get accessor.
E. None of the above
4. If a class Student has an indexer, then which of the following is the correct way to
declare this indexer to make the C#.NET code snippet given below work
successfully?
class Student
{
int[ ] a = new int[5, 5];
public property WriteOnly int this[int i, int j]
{
set
A.
{
a[i, j] = value;
}
}
}
B. class Student
{
int[ , ] a = new int[5, 5];
public int property WriteOnly
{
set
{
a[i, j] = value;
}
}
}
class Student
{
int[ , ] a = new int[5, 5];
public int this[int i, int j]
{
C. set
{
a[i, j] = value;
}
}
}
class Student
{
int[ , ] a = new int[5, 5];
int i, j;
public int this
{
D.
set
{
a[i, j] = value;
}
}
}
1. The signature of an indexer consists of the number and types of its formal
parameters.
2. Indexers are similar to properties except that their accessors take
parameters.
3. Accessors of interface indexers use modifiers.
4. The type of an indexer and the type of its parameters must be at least as
accessible as the indexer itself.
5. An interface accessor contains a body.
6. If Sample class has a Length property with get and set accessors then which of the
following statements will work correctly?
Sample.Length = 20;
Console.WriteLine(Sample.Length);
7. Which of the following is the correct way to implement a write only property
Length in a Sample class?
class Sample
{
public int Length
{
set
A.
{
Length = value;
}
}
}
class Sample
{
int len;
public int Length
{
B. get
{
return len;
}
set
{
len = value;
}
}
}
class Sample
{
int len;
public int Length
{
C. WriteOnly set
{
len = value;
}
}
}
class Sample
{
int len;
public int Length
{
D. set
{
len = value;
}
}
}
9. If a Student class has an indexed property which is used to store or retrieve values
to/from an array of 5 integers, then which of the following are the correct ways to
use this indexed property?
Student[3] = 34;
Console.WriteLine(Student[3]);
C. Sample.Length = 20;
D.Console.WriteLine (Sample.Length);
11. If Sample class has a Length property with get accessor then which of the
following statements will work correctly?
D.Sample.Length = 20;
E. Console.WriteLine(Sample.Length);
12. An Account class has a property called accountNo and acc is a reference to a
bank object and we want the C#.NET code snippet given below to work. Which
of the following options will ensure this functionality?
acc.accountNo = 10;
Console.WriteLine(acc.accountNo);
A.Declare accountNo property with both get and set accessors.
B. Declare accountNo property with only get accessor.
C. Declare accountNo property with get, set and normal accessors.
D.Declare accountNo property with only set accessor.
E. None of the above
13. Suppose a Student class has an indexed property. This property is used to set or
retrieve values to/from an array of 5 integers called scores[]. We want the
property to report "Invalid Index" message if the user attempts to exceed the
bounds of the array. Which of the following is the correct way to implement this
property?
class Student
{
int[] scores = new int[5] {3, 2, 4,1, 5};
public int this[ int index ]
{
set
{
A.
if (index < 5)
scores[index] = value;
else
Console.WriteLine("Invalid Index");
}
}
}
class Student
{
int[] scores = new int[5] {3, 2, 4, 1, 5};
public int this[ int index ]
{
get
{
if (index < 5)
return scores[ index ];
else
B.
{
Console.WriteLine("Invalid Index"); return 0;
}
}
set
{
if (index < 5)
scores[ index ] = value;
else
Console.WriteLine("Invalid Index");
}
}
}
class Student
{
int[] scores = new int[5] {3, 2, 4, 1, 5};
public int this[ int index ]
{
get
{
if (index < 5)
C. return scores[ index ];
else
{
Console.WriteLine("Invalid Index");
return 0;
}
}
}
}
class Student
{
int[] scores = new int[5] {3, 2, 4, 1, 5};
public int this[ int index ]
{
get
{
if (index < 5)
scores[ index ] = value;
else
{
Console.WriteLine("Invalid Index");
}
D.
}
set
{
if (index < 5)
return scores[ index ];
else
{
Console.WriteLine("Invalid Index");
return 0;
}
}
}
}
14. Which of the following statements is correct about properties used in C#.NET?
A.Every property must have a set accessor and a get accessor.
B. Properties cannot be overloaded.
C. Properties of a class are actually methods that work like data members.
D.A property has to be either read only or a write only.
15. Which of the following is the correct way to implement a read only property
Length in a Sample class?
class Sample
{
int len;
public int Length
{
get
A.
{
return len;
}
}
}
class Sample
{
public int Length
{
get
B. {
return Length;
}
}
}
class Sample
{
int len;
public int Length
{
C. get
{
return len;
}
set
{
len = value;
}
}
}
class Sample
{
int len;
public int Length
{
D. Readonly get
{
return len;
}
}
}
16. Which of the folowing does an indexer allow to index in the same way as an
array?
1. A class
2. A property
3. A struct
4. A function
5. An interface
17. An Employee class has a property called age and emp is reference to a Employee
object and we want the statement Console.WriteLine(emp.age) to fail. Which of
the following options will ensure this functionality?
A.Declare age property with only get accessor.
B. Declare age property with only set accessor.
C. Declare age property with both get and set accessors.
D.Declare age property with get, set and normal accessors.
E. None of the above
Exception Handling
3. In C#.NET if we do not catch the exception thrown at runtime then which of the
following will catch it?
A.Compiler
B. CLR
C. Linker
D.Loader
E. Operating system
4. Which of the following statements is correct about the C#.NET program given
below?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index = 6;
int val = 44;
int[] a = new int[5];
try
{
a[index] = val ;
}
catch(IndexOutOfRangeException e)
{
Console.Write("Index out of bounds ");
}
Console.Write("Remaining program");
}
}
}
A.Value 44 will get assigned to a[6].
B. It will output: Index out of bounds
C. It will output: Remaining program
D.It will not produce any output.
E. It will output: Index out of bounds Remaining program
1. If an exception occurs then the program terminates abruptly without getting any
chance to recover from the exception.
2. No matter whether an exception occurs or not, the statements in the finally
clause (if present) will get executed.
3. A program can contain multiple finally clauses.
4. A finally clause is written outside the try block.
5. finally clause is used to perform clean up operations like closing the
network/database connections.
1. If our program does not catch an exception then the .NET CLR catches it.
2. It is possible to create user-defined exceptions.
3. All types of exceptions can be caught using the Exception class.
4. CLRExceptions is the base class for all exception classes.
5. For every try block there must be a corresponding finally block.
7. Which of the following statements are correct about the exception reported below?
Unhandled Exception: System.lndexOutOfRangeException: Index was outside the bounds
of the array: at IndiabixConsoleApplication.MyProgram.SetVal(Int32 index, Int32 val) in
D:\Sample\IndiabixConsoleApplication\MyProgram.cs:line 26 at
IndiabixConsoleApplication.MyProgram.Main(String[] args) in
D:\Sample\IndiabixConsoleApplication\MyProgram.cs:line 20
8. Which of the following is the Object Oriented way of handling run-time errors?
A.OnError
B. HERESULT
C.Exceptions
D.Error codes
E. Setjump and Longjump
9. Which of the following statements is correct about the C#.NET program given
below if a value "6" is input to it?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index;
int val = 44;
int[] a = new int[5];
try
{
Console.Write("Enter a number:");
index = Convert.Tolnt32(Console.ReadLine());
a[index] = val;
}
catch(FormatException e)
{
Console.Write("Bad Format");
}
catch(IndexOutOfRangeException e)
{
Console.Write("Index out of bounds");
}
Console.Write("Remaining program");
}
}
}
A.It will output: Index out of bounds Remaining program
B. It will output: Bad Format Remaining program
C. It will output: Bad Format
D.It will output: Remaining program
E. It will output: Index out of bounds
10. Which of the following statements are correct about the exception reported
below?
Unhandled Exception: System.lndexOutOfRangeException:
Index was outside the bounds of the array.
at IndiabixConsoleApplication.Program.Main(String[] args) in
D:\ConsoleApplication\Program.cs:line 14
11. Which of the following statements are correct about exception handling in
C#.NET?
12. Exceptions can be thrown even from a constructor, whereas error codes cannot
be returned from a constructor.
A.True B.False
13. Which of the following statements is correct about the C#.NET program given
below if a value "6" is input to it?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main (string[] args)
{
int index;
int val = 66;
int[] a = new int[5];
try
{
Consote.Write("Enter a number: ");
index = Convert.ToInt32(Console.ReadLine());
a[index] = val;
}
catch(Exception e)
{
Console.Write("Exception occurred ");
}
Console.Write("Remaining program ");
}
}
}
A.It will output: Exception occurred
B. It will output: Remaining program
C.It will output: Exception occurred Remaining program
D.It will output: Remaining program Exception occurred
E. The value 66 will get assigned to a[6].
14. Which of the following statements is correct about the C#.NET program given
below if a value "ABCD" is input to it?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index;
int val = 55;
int[] a = new int[5];
try
{
Console.Write("Enter a number: ");
index = Convert.ToInt32(Console.ReadLine());
a[index] = val;
}
catch(FormatException e)
{
Console.Write("Bad Format ");
}
catch(IndexOutOfRangeException e)
{
Console.Write("Index out of bounds ");
}
Console.Write("Remaining program ");
}
}
}
A.It will output: Bad Format
B. It will output: Remaining program
C. It will output: Index out of bounds
D.It will output: Bad Format Remaining program
E. It will output: Index out of bounds Remaining program
15. All code inside finally block is guaranteed to execute irrespective of whether an
exception occurs in the protected block or not.
A.True B.False
17. Which of the following statements is correct about the C#.NET program given
below if a value "ABCD" is input to it?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index;
int vat = 88;
int[] a = new int(5];
try
{
Console.Write("Enter a number: ");
index = Convert.Toint32(Console.ReadLine());
a[index] = val;
}
catch(Exception e)
{
Console.Write("Exception occurred");
}
Console.Write("Remaining program");
}
}
}
A.It will output: Exception occurred
B. It will output: Remaining program
C. It will output: Remaining program Exception occurred
D.It will output: Exception occurred Remaining program
E. The value 88 will get assigned to a[0].
18. It is compulsory for all classes whose objects can be thrown with throw statement
to be derived from System.Exception class.
A.True B.False
Structure
3. Which of the following will be the correct output for the C#.NET program given
below?
namespace IndiabixConsoleApplication
{
struct Sample
{
public int i;
}
class MyProgram
{
static void Main()
{
Sample x = new Sample();
x.i = 10;
fun(x);
Console.Write(x.i + " ");
}
static void fun(Sample y)
{
y.i = 20;
Console.Write(y.i + " ");
}
}
}
A.10 20
B. 10 10
C.20 10
D.20 20
E. None of the above
4. Which of the following is the correct way of setting values into the structure variable e
defined below?
struct Emp
{
public String name;
public int age;
public Single sal;
}
Emp e = new Emp();
e.name = "Amol";
A.e.age = 25;
e.sal = 5500;
With e
{
B. .name = "Amol";
.age = 25;
.sal = 5500;
}
C. With emp e
{
.name = "Amol";
.age = 25;
.sal = 5500;
}
e -> name = "Amol";
D.e -> age = 25;
e -> sal = 5500;
name = "Amol";
E. age = 25;
sal = 5500;
5. Which of the following is the correct way to define a variable of the type struct Emp
declared below?
struct Emp
{
private String name;
private int age;
private Single sal;
}
6. Which of the following statements is correct about the C#.NET code snippet given below?
class Trial
{
int i;
Decimal d;
}
struct Sample
{
private int x;
private Single y;
private Trial z;
}
Sample ss = new Sample();
A.ss will be created on the heap.
B. Trial object referred by z will be created on the stack.
C. z will be created on the heap.
D.Both ss and z will be created on the heap.
E. ss will be created on the stack.
7. How many bytes will the structure variable samp occupy in memory if it is defined as
shown below?
class Trial
{
int i;
Decimal d;
}
struct Sample
{
private int x;
private Single y;
private Trial z;
}
Sample samp = new Sample();
A.20 bytes
B. 12 bytes
C. 8 bytes
D.16 bytes
E. 24 bytes
8. Which of the following will be the correct result of the statement b = a in the C#.NET
code snippet given below?
struct Address
{
private int plotno;
private String city;
}
Address a = new Address();
Address b;
b = a;
A.All elements of a will get copied into corresponding elements of b.
B. Address stored in a will get copied into b.
C. Once assignment is over a will get garbage collected.
D.Once assignment is over a will go out of scope, hence will die.
E. Address of the first element of a will get copied into b.
12. Which of the following statements is correct about the C#.NET code snippet given
below?
struct Book
{
private String name;
private int noofpages;
private Single price;
}
Book b = new Book();
A.The structure variable b will be created on the heap.
B. We can add a zero-argument constructor to the above structure.
C. When the program terminates, variable b will get garbage collected.
D.The structure variable b will be created on the stack.
E. We can inherit a new structure from struct Book.
13. Which of the following will be the correct output for the C#.NET program given
below?
namespace IndiabixConsoleApplication
{
struct Sample
{
public int i;
}
class MyProgram
{
static void Main(string[] args)
{
Sample x = new Sample();
x.i = 10;
fun(ref x);
Console.Write(x.i + " ");
}
public static void fun(ref Sample y)
{
y.i = 20;
Console.Write(y.i + " ");
}
}
}
A.20 10
B. 10 20
C. 10 10
D.20 20
E. None of the above
15. Which of the following statements are correct about the structure declaration given
below?
struct Book
{
private String name;
protected int totalpages;
public Single price;
public void Showdata()
{
Console.WriteLine(name + " " + totalpages + " " + price);
}
Book()
{
name = " ";
totalpages = 0;
price = 0.0f;
}
}
Book b = new Book();
16. Which of the following are true about classes and struct?
17. Which of the following will be the correct output for the program given below?
namespace IndiabixConsoleApplication
{
struct Sample
{
public int i;
}
class MyProgram
{
static void Main(string[] args)
{
Sample x = new Sample();
Sample y;
x.i = 9;
y = x;
y.i = 5;
Console.WriteLine(x.i + " " + y.i);
}
}
}
A.9 9
B. 9 5
C. 5 5
D.5 9
E. None of the above
18. Which of the following statements are correct about Structures used in C#.NET?
A.1, 2, 4
B. 2, 3, 5
C. 2, 4
D.1, 3
Namespaces
1. If a namespace is present in a library then which of the following is the correct way to
use the elements of the namespace?
Add Reference of the namespace.
A.
Use the elements of the namespace.
Add Reference of the namespace.
B. Import the namespace.
Use the elements of the namespace.
Import the namespace.
C.
Use the elements of the namespace.
Copy the library in the same directory as the project that is trying to use it.
D.
Use the elements of the namespace.
Install the namespace in Global Assembly Cache.
E.
Use the elements of the namespace.
2. Which of the following is NOT a namespace in the .NET Framework Class Library?
A.System.Process
B. System.Security
C. System.Threading
D.System.Drawing
E. System.Xml
3. Which of the following statments are the correct way to call the method Issue() defined in
the code snippet given below?
namespace College
{
namespace Lib
{
class Book
{
public void Issue()
{
// Implementation code
}
}
class Journal
{
public void Issue()
{
// Implementation code
}
}
}
}
College.Lib.Book b = new College.Lib.Book();
b.Issue();
using College.Lib;
Book b = new Book();
b.Issue();
using College;
Lib.Book b = new Lib.Book();
b.Issue();
using College.Lib.Book;
Book b = new Book();
b.Issue();
1. System.Web
2. System.Process
3. System.Data
4. System.Drawing2D
5. System.Drawing3D
9. Which of the following is correct way to rewrite the C#.NET code snippet given
below?
using Microsoft.VisualBasic;
using System.Windows.Forms;
MessageBox.Show("Wait for a" + ControlChars.CrLf + "miracle");
using System.Windows.Forms;
A.using CtrlChars = Microsoft.VisualBasic.ControlChars;
MessageBox.Show("Wait for a" + CrLf + "miracle");
using Microsoft.VisualBasic;
using System.Windows.Forms;
B.
CtrlChars = ControlChars;
MessageBox.Show("Wait for a" + CtrlChars.CrLf + "miracle");
C. using Microsoft.VisualBasic;
using System.Windows.Forms;
CtrlChars = ControlChars;
MessageBox.Show ("Wait for a" + CrLf + "miracle");
using System.Windows.Forms;
D.using CtrlChars = Microsoft.VisualBasic.ControlChars;
MessageBox.Show("Wait for a" + CtrlChars.CrLf + "miracle");
10. Which of the following statements is correct about the using statement used in
C#.NET?
A.using statement can be placed anywhere in the C#.NET source code file.
B. It is permitted to define a member at namespace level as a using alias.
C.A C#.NET source code file can contain any number of using statement.
By using using statement it is possible to create an alias for the namespace but not
D.
for the namespace element.
By using using statement it is possible to create an alias for the namespace element
E.
but not for the namespace.
11. Which of the following statements are correct about a namespace used in C#.NET?
13. Which of the following statements is correct about a namespace used in C#.NET?
A.Nested namespaces are not allowed.
B. Importing outer namespace imports inner namespace.
C.Nested namespaces are allowed.
D.If nested, the namespaces cannot be split across files.
14. Which of the following C#.NET code snippets will correctly print "Hello C#.NET"?
A.import System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
Console.WriteLine("Hello C#.NET");
}
}
}
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
B. static void Main(string[ ] args)
{
WriteLine("Hello C#.NET");
}
}
}
using System.Console;
namespace IndiabixConsoleApplication
{
class MyProgram
{
C. static void Main (string[ ] args)
{
WriteLine("Hello C#.NET");
}
}
}
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
D. static void Main(string[] args)
{
Console.WriteLine("Hello C#.NET");
}
}
}
using System.Windows.Forms;
ListBox lb = new ListBox();
Interfaces
1. Which of the following statements is correct about the C#.NET code snippet given
below?
interface IMyInterface
{
void fun1();
int fun2();
}
class MyClass: IMyInterface
{
void fun1()
{}
int IMyInterface.fun2()
{}
}
A.A function cannot be declared inside an interface.
B. A subroutine cannot be declared inside an interface.
C. A Method Table will not be created for class MyClass.
D.MyClass is an abstract class.
E. The definition of fun1() in class MyClass should be void IMyInterface.fun1().
2. Which of the following can be declared in an interface?
1. Properties
2. Methods
3. Enumerations
4. Events
5. Structures
3. A class implements two interfaces each containing three methods. The class contains
no instance data. Which of the following correctly indicate the size of the object
created from this class?
A.12 bytes
B. 24 bytes
C. 0 byte
D.8 bytes
E. 16 bytes
9. Which of the following is the correct implementation of the interface given below?
interface IMyInterface
{
double MyFun(Single i);
}
class MyClass
{
double MyFun(Single i) as IMyInterface.MyFun
A. {
// Some code
}
}
class MyClass
{
MyFun (Single i) As Double
B. {
// Some code
}
}
class MyClass: implements IMyInterface
{
double fun(Single si) implements IMyInterface.MyFun()
C.
{
//Some code
}
}
class MyClass: IMyInterface
{
double IMyInterface.MyFun(Single i)
D. {
// Some code
}
}
11. Which of the following statements are correct about an interface used in
C#.NET?
1. Data
2. Class
3. Enum
4. Structure
5. Namespace
13. Which of the following statements is correct about the C#.NET code snippet given
below?
interface IMyInterface
{
void fun1();
void fun2();
}
class MyClass: IMyInterface
{
private int i;
void IMyInterface.fun1()
{
// Some code
}
}
A.Class MyClass is an abstract class.
B. Class MyClass cannot contain instance data.
C. Class MyClass fully implements the interface IMyInterface.
D.Interface IMyInterface should be inherited from the Object class.
The compiler will report an error since the interface IMyInterface is only partially
E.
implemented.
14. Which of the following statements is correct about the C#.NET code snippet
given below?
interface IPerson
{
String FirstName
{
get;
set;
}
String LastName
{
get;
set;
}
void Print();
void Stock();
int Fun();
}
A.Properties cannot be declared inside an interface.
B. This is a perfectly workable interface.
C. The properties in the interface must have a body.
D.Subroutine in the interface must have a body.
E. Functions cannot be declared inside an interface.
15. Which of the following is the correct way to implement the interface given
below?
interface IPerson
{
String FirstName
{
get;
set;
}
}
class Employee : IPerson
{
private String str;
public String FirstName
{
get
{
A. return str;
}
set
{
str = value;
}
}
}
class Employee
{
private String str;
public String IPerson.FirstName
{
get
B.
{
return str;
}
set
{
str = value;
}
}
}
class Employee : implements IPerson
{
private String str;
public String FirstName
{
get
{
C. return str;
}
set
{
str = value;
}
}
}
D.None of the above
Datatypes
1. If the integer literal exceeds the range of byte, a compilation error will
occur.
2. We cannot implicitly convert non-literal numeric types of larger storage
size to byte.
3. Byte cannot be implicitly converted to float.
4. A char can be implicitly converted to only int data type.
5. We can cast the integral character codes.
1. Integer
2. Array
3. Single
4. String
5. Long
8. What will be the output of the following code snippet when it is executed?
int x = 1;
float y = 1.1f;
short z = 1;
Console.WriteLine((float) x + y * z - (x += (short) y));
A.0.1 B. 1.0
C. 1.1 D.11
9. Which of the following statements is correct about the C#.NET code snippet given
below?
short s1 = 20;
short s2 = 400;
int a;
a = s1 * s2;
A.A value 8000 will be assigned to a.
B. A negative value will be assigned to a.
During arithmetic if the result exceeds the high or low value of the range the value
C.
wraps around till the other side of the range.
D.An error is reported as widening conversion cannot takes place.
An overflow error will be reported since the result of the multiplication exceeds the
E.
range of a Short Integer.
12. Which of the following is the correct ways to set a value 3.14 in a variable pi such
that it cannot be modified?
A.float pi = 3.14F;
B. #define pi 3.14F;
C.const float pi = 3.14F;
D.const float pi; pi = 3.14F;
E. pi = 3.14F;
13. Which of the following statements are correct about data types?
1. Each value type has an implicit default constructor that initializes the
default value of that type.
2. It is possible for a value type to contain the null value.
3. All value types are derived implicitly from System.ValueType class.
4. It is not essential that local variables in C# must be initialized before being
used.
5. Variables of reference types referred to as objects and store references to
the actual data.
14. Which of the following are the correct way to initialise the variables i and j to a
value 10 each?
16. Which of the following statements are correct about datatypes in C#.NET?
17. Which of the following is the correct default value of a Boolean type?
A.0 B. 1
C. True D.False
E. -1
Exception Handling
3. In C#.NET if we do not catch the exception thrown at runtime then which of the
following will catch it?
A.Compiler
B. CLR
C. Linker
D.Loader
E. Operating system
4. Which of the following statements is correct about the C#.NET program given
below?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index = 6;
int val = 44;
int[] a = new int[5];
try
{
a[index] = val ;
}
catch(IndexOutOfRangeException e)
{
Console.Write("Index out of bounds ");
}
Console.Write("Remaining program");
}
}
}
A.Value 44 will get assigned to a[6].
B. It will output: Index out of bounds
C. It will output: Remaining program
D.It will not produce any output.
E. It will output: Index out of bounds Remaining program
5. Which of the following statements are correct about exception handling in C#.NET?
1. If an exception occurs then the program terminates abruptly without getting any
chance to recover from the exception.
2. No matter whether an exception occurs or not, the statements in the finally
clause (if present) will get executed.
3. A program can contain multiple finally clauses.
4. A finally clause is written outside the try block.
5. finally clause is used to perform clean up operations like closing the
network/database connections.
6. Which of the following statements are correct about exception handling in C#.NET?
1. If our program does not catch an exception then the .NET CLR catches it.
2. It is possible to create user-defined exceptions.
3. All types of exceptions can be caught using the Exception class.
4. CLRExceptions is the base class for all exception classes.
5. For every try block there must be a corresponding finally block.
7. Which of the following statements are correct about the exception reported below?
Unhandled Exception: System.lndexOutOfRangeException: Index was outside the
bounds of the array: at IndiabixConsoleApplication.MyProgram.SetVal(Int32 index,
Int32 val) in D:\Sample\IndiabixConsoleApplication\MyProgram.cs:line 26 at
IndiabixConsoleApplication.MyProgram.Main(String[] args) in
D:\Sample\IndiabixConsoleApplication\MyProgram.cs:line 20
8. Which of the following is the Object Oriented way of handling run-time errors?
A.OnError
B. HERESULT
C.Exceptions
D.Error codes
E. Setjump and Longjump
9. Which of the following statements is correct about the C#.NET program given
below if a value "6" is input to it?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index;
int val = 44;
int[] a = new int[5];
try
{
Console.Write("Enter a number:");
index = Convert.Tolnt32(Console.ReadLine());
a[index] = val;
}
catch(FormatException e)
{
Console.Write("Bad Format");
}
catch(IndexOutOfRangeException e)
{
Console.Write("Index out of bounds");
}
Console.Write("Remaining program");
}
}
}
A.It will output: Index out of bounds Remaining program
B. It will output: Bad Format Remaining program
C. It will output: Bad Format
D.It will output: Remaining program
E. It will output: Index out of bounds
10. Which of the following statements are correct about the exception reported
below?
Unhandled Exception: System.lndexOutOfRangeException:
Index was outside the bounds of the array.
at IndiabixConsoleApplication.Program.Main(String[] args) in
D:\ConsoleApplication\Program.cs:line 14
11. Which of the following statements are correct about exception handling in
C#.NET?
12. Exceptions can be thrown even from a constructor, whereas error codes cannot
be returned from a constructor.
A.True B.False
13. Which of the following statements is correct about the C#.NET program given
below if a value "6" is input to it?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main (string[] args)
{
int index;
int val = 66;
int[] a = new int[5];
try
{
Consote.Write("Enter a number: ");
index = Convert.ToInt32(Console.ReadLine());
a[index] = val;
}
catch(Exception e)
{
Console.Write("Exception occurred ");
}
Console.Write("Remaining program ");
}
}
}
A.It will output: Exception occurred
B. It will output: Remaining program
C.It will output: Exception occurred Remaining program
D.It will output: Remaining program Exception occurred
E. The value 66 will get assigned to a[6].
14. Which of the following statements is correct about the C#.NET program given
below if a value "ABCD" is input to it?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index;
int val = 55;
int[] a = new int[5];
try
{
Console.Write("Enter a number: ");
index = Convert.ToInt32(Console.ReadLine());
a[index] = val;
}
catch(FormatException e)
{
Console.Write("Bad Format ");
}
catch(IndexOutOfRangeException e)
{
Console.Write("Index out of bounds ");
}
Console.Write("Remaining program ");
}
}
}
A.It will output: Bad Format
B. It will output: Remaining program
C. It will output: Index out of bounds
D.It will output: Bad Format Remaining program
E. It will output: Index out of bounds Remaining program
15. All code inside finally block is guaranteed to execute irrespective of whether an
exception occurs in the protected block or not.
A.True B.False
17. Which of the following statements is correct about the C#.NET program given
below if a value "ABCD" is input to it?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index;
int vat = 88;
int[] a = new int(5];
try
{
Console.Write("Enter a number: ");
index = Convert.Toint32(Console.ReadLine());
a[index] = val;
}
catch(Exception e)
{
Console.Write("Exception occurred");
}
Console.Write("Remaining program");
}
}
}
A.It will output: Exception occurred
B. It will output: Remaining program
C. It will output: Remaining program Exception occurred
D.It will output: Exception occurred Remaining program
E. The value 88 will get assigned to a[0].
18. It is compulsory for all classes whose objects can be thrown with throw statement
to be derived from System.Exception class.
A.True B.False
Collection Classes
1. Which of the following statements are correct about an ArrayList collection that
implements the IEnumerable interface?
2. How many enumerators will exist if four threads are simultaneously working on
an ArrayList object?
A. 1
B. 3
C.2
D.4
E. Depends upon the Project Setting made in Visual Studio.NET.
1. Stack
2. Queue
3. BitArray
4. ArrayList
5. HashTable
1. Map
2. Stack
3. BitArray
4. HashTable
5. SortedList
6. Which of the following statements are correct about the C#.NET code snippet
given below?
7. Which of the following statements are correct about the Stack collection?
9. Which of the following is the correct way to access all elements of the Queue
collection created using the C#.NET code snippet given below?
IEnumerator e;
e = q.GetEnumerator();
A.while (e.MoveNext())
Console.WriteLine(e.Current);
B. IEnumerable e;
e = q.GetEnumerator();
while (e.MoveNext())
Console.WriteLine(e.Current);
IEnumerator e;
e = q.GetEnumerable();
C.while (e.MoveNext())
Console.WriteLine(e.Current);
IEnumerator e;
e = Queue.GetEnumerator();
D.while (e.MoveNext())
Console.WriteLine(e.Current);
11. Suppose value of the Capacity property of ArrayList Collection is set to 4. What
will be the capacity of the Collection on adding fifth element to it?
A. 4 B.8
C.16 D.32
1. Map
2. Stack
3. Queue
4. BitArray
5. HashTable
13. Which of the following is the correct way to find out the number of elements
currently present in an ArrayList Collection called arr?
A.arr.Count
B. arr.GrowSize
C.arr.MaxIndex
D.arr.Capacity
E. arr.UpperBound
14. Which of the following statements are correct about a HashTable collection?
1. It is a keyed collection.
2. It is a ordered collection.
3. It is an indexed collection.
4. It implements a IDictionaryEnumerator interface in its inner class.
5. The key - value pairs present in a HashTable can be accessed using the
Keys and Values properties of the inner class that implements the
IDictionaryEnumerator interface.
15. Which of the following is the correct way to access all elements of the Stack
collection created using the C#.NET code snippet given below?
IEnumerable e;
e = st.GetEnumerator();
A. while (e.MoveNext())
Console.WriteLine(e.Current);
IEnumerator e;
e = st.GetEnumerable();
B. while (e.MoveNext())
Console.WriteLine(e.Current);
IEnumerator e;
e = st.GetEnumerator();
C.while (e.MoveNext())
Console.WriteLine(e.Current);
IEnumerator e;
e = Stack.GetEnumerator();
D.while (e.MoveNext())
Console.WriteLine(e.Current);
16. Which of the following statements are correct about the Collection Classes
available in Framework Class Library?
A. Elements of a collection cannot be transmitted over a network.
B. Elements stored in a collection can be retrieved but cannot be modified.
It is not easy to adopt the existing Collection classes for newtype of
C.
objects.
Elements stored in a collection can be modified only if allelements are of
D.
similar types.
They use efficient algorithms to manage the collection, thereby
E.
improving the performance of the program.
Enumeration
1. Which of the following statements are correct about an enum used inC#.NET?
1. By default the first enumerator has the value equal to the number of elements
present in the list.
2. The value of each successive enumerator is decreased by 1.
3. An enumerator contains white space in its name.
4. A variable cannot be assigned to an enum element.
5. Values of enum elements cannot be populated from a database.
2. Which of the following statements is correct about the C#.NET code snippet given
below?
int a = 10;
int b = 20;
int c = 30;
enum color: byte
{
red = a,
green = b,
blue = c
}
A.Variables cannot be assigned to enum elements.
B. Variables can be assigned to any one of the enum elements.
C.Variables can be assigned only to the first enum element.
D.Values assigned to enum elements must always be successive values.
E. Values assigned to enum elements must always begin with 0.
4. Which of the following is the correct output for the C#.NET code snippet given
below?
enum color
{
red,
green,
blue
}
color c;
c = color.red;
Console.WriteLine(c);
A. 1 B. -1
C.red D.0
E. color.red
5. Which of the following statements are correct about an enum used inC#.NET?
6. Which of the following will be the correct output for the C#.NET code snippet given
below?
8. Which of the following statements is correct about the C#.NET code snippet given
below?
enum per
{
married,
unmarried,
divorced,
spinster
}
per.married = 10;
Console.WriteLine(per.unmarried);
A. The program will output a value 11.
B. The program will output a value 1.
C.The program will output a value 2.
D.The program will report an error since an enum element cannot be
assigned a value outside the enum declaration.
E. The enum elements must be declared private.
9. Which of the following is the correct output for the C#.NET code snippet given
below?
12. Which of the following statements are correct about enum used in C#.NET?
13. Which of the following statements is correct about the C#.NET code snippet given
below?
14. Which of the following is the correct output for the C#.NET code snippet given
below?
enum color
{
red,
green,
blue
}
color c = color.red;
Type t;
t = c.GetType();
string[ ]str;
str = Enum.GetNames(t);
Console.WriteLine(str[ 0 ]);
A.red B. 0
C.1 D.-1
E. color.red
15. Which of the following statements are correct about the C#.NET code snippet
given below?
namespace IndiabixConsoleApplication
(
class Sample
{
private enum color : int
{
red,
green,
blue
}
public void fun()
{
Console.WriteLine(color.red);
}
}
class Program
{
static void Main(string[ ] args)
{
// Use enum color here
}
}
}
16. Which of the following statements is correct about an enum used in C#.NET?
A. enum is a reference type.
B.enum is a value type.
C.Whether it a value type or a reference type depends upon size.
Whether it a value type or a reference type depends upon a Project Setting
D.
made in Visual Stiiclio.NET.
We can programmatically control whether it is a value type or a reference
E.
type.
17. Which of the following statements are correct about an enum used in C#.NET?
Attributes
2. Which of the following are correct ways to specify the targets for a custom
attribute?
A. By applying AttributeUsage to the custom attribute's class definition.
B. By applying UsageAttribute to the custom attribute's class definition.
C.Once an attribute is declared it applies to all the targets.
By applying AttributeUsageAttribute to the custom attribute's class
D.
definition.
E. None of the above.
1. By value
2. By reference
3. By address
4. By position
5. By name
6. Which of the following statements are correct about Attributes used in C#.NET?
A. If there is a custom attribute BugFixAttribute then the compiler will look
ONLY for the BugFix attribute in the code that uses this attribute.
To create a custom attribute we need to create a custom attribute structure
B.
and derive it from System.Attribute.
To create a custom attribute we need to create a class and implement
C.
IAttribute interface in it.
If a BugFixAttribute is to receive three parameters then the BugFixAttribute
D.
class should implement a zero-argument constructor.
The CLR can change the behaviour of the code depending upon the
E.
attributes applied to it.
10. It possible to create a custom attribute that can be applied only to specific
programming element(s) like ____ .
A. Classes
B. Methods
C.Classes and Methods
D.Classes, Methods and Member-Variables
12. Once applied which of the following CANNOT inspect the applied attribute?
A. CLR
B.Linker
C.ASP.NET Runtime
D.Visual Studio.NET
E. Language compilers
13. Which of the following is the correct way to apply an attribute to an Assembly?
A. [ AssemblyDescription("DCube Component Library") ]
B.[ assembly : AssemblyDescription("DCube Component Library") ]
C.[ Assemblylnfo : AssemblyDescription("DCube Component Library") ]
D.< Assembly: AssemblyDescription("DCube Component Library") >
E. (Assembly: AssemblyDescription("DCube Component Library"))
14. Which of the following is the correct way of applying the custom attribute called
Tested which receives two-arguments - name of the tester and the testgrade?
1. Method
2. Class
3. Assembly
4. Namespace
5. Enum
Generics
1. Stack
2. Tree
3. SortedDictionary
4. SortedArray
2. For the code snippet shown below, which of the following statements are valid?
3. Which of the following statements are valid about generics in .NET Framework?
5. For the code snippet shown below, which of the following statements are valid?
6. For the code snippet given below, which of the following statements is valid?
7. For the code snippet given below, which of the following statements are valid?
8. For the code snippet given below, which of the following statements are valid?
Delegates
1. Remoting
2. Serialization
3. File Input/Output
4. Multithreading
5. Event handling
4. Which of the following statements are correct about the delegate declaration
given below?
5. Which of the following is the correct way to call the function MyFun() of the
Sample class given below?
class Sample
{
public int MyFun(int i)
{
Console.WriteLine("Welcome to IndiaBIX.com !" );
return 0;
}
}
delegate void del(int i);
A. Sample s = new Sample();
deld = new del(ref s.MyFun);
d(10);
6. Which of the following is the correct way to call subroutine MyFun() of the
Sample class given below?
class Sample
{
public void MyFun(int i, Single j)
{
Console.WriteLine("Welcome to IndiaBIX !");
}
}
delegate void del(int i);
Sample s = new Sample();
A. del d = new del(ref s.MyFun);
d(10, 1.1f);
delegate void del(int i, Single j);
del d;
B.Sample s = new Sample();
d = new del(ref s.MyFun);
d(10, 1.1f);
Sample s = new Sample();
C.delegate void d = new del(ref MyFun);
d(10, 1.1f);
delegate void del(int i, Single]);
Sample s = new Sample();
D.del = new delegate(ref MyFun);
del(10, 1.1f);
10. Which of the following are the correct ways to declare a delegate for calling the
function func() defined in the sample class given below?
class Sample
{
public int func(int i, Single j)
{
/* Add code here. */
}
}
A. delegate d(int i, Single j);
B. delegate void d(int, Single);
C.delegate int d(int i, Single j);
D.delegate void (int i, Single j);
E. delegate int sample.func(int i, Single j);
11. Suppose on pushing a button an object is to be notified, but it is not known until
runtime which object should be notified. Which of the following programming
constructs should be used to implement this idea?
A. Attribute B.Delegate
C.Namespace D.Interface
E. Encapsulation
14. With which of the following can the ref keyword be used?
1. Static data
2. Instance data
3. Static function/subroutine
4. Instance function/subroutine
When Enable editing is done in gridview