ExamVeda
Login
Home
31
Wrong statement about inheritance in C# .NET?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
32
Correct way of declaration of object of the following class is?
class name
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
33
Select the sequence of execution of function f1(), f2() & f3() in C# .NET CODE?
class base
{
    public void f1() {}
    public virtual void f2() {}
    public virtual  void f3() {}
}
class derived :base
{
    new public void f1() {}
    public override void f2() {}
    public new void f3() {}
} 
class Program
{
    static void Main(string[] args)
    {
        baseclass b = new derived();
        b.f1 ();
        b.f2 ();
        b.f3 ();
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
34
The following C# code is run on single level of inheritance. What will be the Correct statement in the following C# code?
class sample
{
    int i = 10;
    int j = 20;
    public void display() 
    {
        Console.WriteLine("base method ");
    }
}    
class sample1 : sample 
{
    public  int s = 30;
}    
class Program
{
    static void Main(string[] args)
    {
        sample1 obj = new sample1();
        Console.WriteLine("{0}, {1}, {2}", obj.i,  obj.j,  obj.s);
        obj.display();
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
35
What is the return type of constructors?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
36
Which keyword is used for correct implementation of an interface in C#.NET?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
37
What will be the output of the following C# code?
public static void Main(string[] args)
{
    p();
    void p()
    {
        Console.WriteLine("hi");
    }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
38
Can the method add() be overloaded in the following ways in C#?
public int add()  {    }
public float add(){    }
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board