C# Test 4

Which of the following .NET components can be used to remove unused references from the managed heap?

Which of the following assemblies can be stored in Global Assembly Cache?

Which of the following does not store a sign?

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

Which of the following statements is correct?

Which of the following statements are correct about static functions?
1. Static functions can access only static data.
2. Static functions cannot call instance functions.
3. It is necessary to initialize static data.
4. Instance functions can call static functions and access static data.
5. this reference is passed to static functions.


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

class Sample
{
static int i;
int j;
public void proc1()
{
i = 11;
j = 22;
}
public static void proc2()
{
i = 1;
j = 2;
}
static Sample()
{
i = 0;
j = 0;
}
}

Multiple inheritance is different from multiple levels of inheritance.

The way a derived class member function can access base class public members, the base class member functions can access public member functions of derived class.

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

String s1 = "ALL MEN ARE CREATED EQUAL";
String s2;
s2 = s1.Substring(12, 3);
Console.WriteLine(s2);

Which of the following statement is correct about a String in C#.NET?

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 HashTable t maintains a collection of names of states and capital city of each state. Which of the following is the correct way to find out whether "Kerala" state is present in this collection or not?

Which of the following statements is correct about an Exception?

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

Which of the following is the correct way to overload + operator?

Which of the following statements is correct?

Schreibe einen Kommentar