61.
What will be the output of the following C# code?
class maths
{
    public int length;
    public int breadth;
    public  maths(int x)
    {
        length = x + 1;
    }
    public maths(int x, int y)
    {
        length = x + 2;
    }
}
class Program
{
    static void Main(string[] args)
    {
        maths m = new maths(6);
        maths k = new maths(6, 2);
        Console.WriteLine(m.length);
        Console.WriteLine(k.length);
        Console.ReadLine();
    }
}

63.
In an inheritance chain through which of the following, the base class and its components are accessible to the derived class?

64.
What will be the output of the following C# code?
public class sample
{
    public static int x = 100;
    public static int y = 150;

}
public class newspaper :sample
{
    new public static int x = 1000;
    static void Main(string[] args)
    {
        console.writeline(sample.x + "  " + sample.y + "  " + x);
    }
}

67.
What will be the output of the following C# code?
class box
{
    public int volume;
    int width;
    int height;
    int length;
    public box ( int w, int h, int l)
    {
        width = w;
        height = h;
        length = l;
    }
   public ~box()
   {
       volume = width * length * height;

   }

}    
class Program
{
    static void Main(string[] args)
    {
       box b = new box(4, 5, 9);
       Console.WriteLine(b.volume);
       Console.ReadLine();
   }
 
}

69.
Choose the statements which makes interface different from classes?

70.
What will be the output of the following C# code?
using System;
public class BaseClass
{
    public BaseClass()
    {
        Console.WriteLine("I am a base class");
    }
}
public class ChildClass : BaseClass
{
    public ChildClass()
    {
        Console.WriteLine ("I am a child class");
    }
static void Main()
{
    ChildClass CC = new ChildClass();
}
}

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.