11.
Name a method which has the same name as that of class and which is used to destroy objects also called automatically when application is finally on process of being getting terminated.

12.
Which statements are correct about operator overloading?

13.
Choose the wrong statement from the given set of statements?

14.
What will be the output of the following C# code?
interface calc
{
    void cal(int i);
}
public  class maths :calc 
{
    public int x;
    public void cal(int i) 
    {
        x = i * i;            
    }
}
class Program
{
    public static void Main(string[] args)
    {            
        display arr = new display();
        arr.x = 0;      
        arr.cal(2);
        Console.WriteLine(arr.x);
        Console.ReadLine();
    }
}

15.
What will be the output of the following C# code?
enum color:int
{
    red,
    green,
    blue = 5,
    cyan,
    pink = 10,
    brown
}
console.writeline((int)color.green);
console.writeline((int)color.brown);

16.
What will be the output of the following C# code?
class maths
{
    int i;
    public  maths(int ii)
    {
        ii = -25;
        int g;
        g = ii > 0 ? ii : ii * -1;
        Console.WriteLine(g);
    }
}
class maths1 :maths
{
    public  maths1(int ll) :base(ll)
    {
        ll = -1000;
        Console.WriteLine((ll > 0 ? ll : ll * -1));
    }
}
class Program
{
    static void Main(string[] args)
    {
        maths1 p = new maths1(6);
        Console.ReadLine();
    }
}

19.
What will be the output of the following C# code?
class maths
{
    public static void fun1()
    {
        Console.WriteLine("method 1 :");
    }
    public void fun2()
    {
        fun1();
        Console.WriteLine("method 2 :");
    }
    public void fun2(int k)
    {
        Console.WriteLine(k);
        fun2();
    }
}    
class Program
{
    static void Main(string[] args)
    {
        maths obj = new maths();
        maths.fun1();
        obj.fun2(20);
        Console.ReadLine();
    }
}

20.
What will be the output of the following C# code?
static void Main(string[] args)
{
    int a = 10 , b = 20;
    Console.WriteLine("Result before swap is: "+ a +" "+b);
    swap(ref a, ref b);
    Console.ReadLine();
}
static void swap(ref int i, ref int j)
{
    int t;
    t = i;
    i = j;
    j = t;
    Console.WriteLine("Result after swap is:"+ i +" "+j);
}

Read More Section(Classes and Objects in C Sharp)

Each Section contains maximum 100 MCQs question on Classes and Objects in C Sharp. To get more questions visit other sections.