ExamVeda
Login
Home
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();
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
62
Which of the following cannot be used to declare an interface correctly?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
63
In an inheritance chain through which of the following, the base class and its components are accessible to the derived class?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
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);
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
65
Which of the following is used to define the member of a class externally?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
66
Which of these can be overloaded?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
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();
   }
 
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
68
Operator used to free the memory when memory is allocated?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
69
Choose the statements which makes interface different from classes?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
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();
}
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board