C# Test 5

Which of the following statements is correct about the .NET Framework?

Which of the following is an 8-byte Integer?

Which of the following statements is correct?

Which of the following statements is correct about the C#.NET code snippet given below?

int i, j, id = 0; switch (id)
{
case i:
Console.WriteLine("I am in Case i");
break;

case j:
Console.WriteLine("I am in Case j");
break;
}

Which of the following is NOT an Arithmetic operator in C#.NET?

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 + " ");
}

Which of the following statements are correct?
1. C# allows a function to have arguments with default values.
2. C# allows a function to have variable number of arguments.
3. Omitting the return value type in method definition results into an exception.
4. Redefining a method parameter in the method's body causes an exception.
5. params is used to specify the syntax for a function with variable number of arguments.


Which of the following statements is correct?

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();
}
}
}

How many times can a constructor be called during lifetime of the object?

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);
}
}
}

Which of the following statements are correct about Inheritance in C#.NET?
1. A derived class object contains all the base class data.
2. Inheritance cannot suppress the base class functionality.
3. A derived class may not be able to access all the base class data.
4. Inheritance cannot extend the base class functionality.
5. In inheritance chain construction of object happens from base towards derived.


Which of the following statements are correct about the C#.NET code snippet given below?

int[] a = {11, 3, 5, 9, 4};

1. The array elements are created on the stack.
2. Refernce a is created on the stack.
3. The array elements are created on the heap.
4. On declaring the array a new array class is created which is derived from System.Array Class.
5. Whether the array elements are stored in the stack or heap depends upon the size of the array.

Which of the following will be the correct output for the C#.NET code snippet given below?

String s1 = "Five Star";
String s2 = "FIVE STAR";
int c;
c = s1.CompareTo(s2);
Console.WriteLine(c);

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. */
}
}

Which of the following is the correct way to find out the number of elements currently present in an ArrayList Collection called arr?

Which of the followings are NOT a .NET namespace?
1. System.Web
2. System.Process
3. System.Data
4. System.Drawing2D
5. System.Drawing3D

Which of the following modifier is used when a virtual method is redefined by a derived class?

Schreibe einen Kommentar