ExamVeda
Login
Home
61
What will be the output of the following C# code?
static void Main(string[] args)
{
    int i = 10;
    double d = 35.78;
    fun(i);
    fun(d);
    Console.ReadLine();
}
static void fun(double d)
{
    Console.WriteLine(d);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
62
What will be the Correct statement in the following C# code?
class baseclass
{
    int a;
    public baseclass(int a1) 
    {
        a = a1;
        console.writeline(" a ");
    }
    class derivedclass : baseclass
    {
        public derivedclass (int a1) : base(a1)
        {
            console.writeline(" b ");
        }
    }
    class program
    {
        static void main(string[] args)
        {
            derivedclass d =  new derivedclass(20);
        }
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
63
The process of defining a method in a subclass having same name & type signature as a method in its superclass is known as?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
64
Wrong statement about enum used in C#.NET is?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
65
What is the return type of destructor?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
66
What will be the output of the following C# code?
class A 
{
    public int i;
    protected int j;
}    
class B : A 
{
    public int j;
    public void display() 
    {
        base.j = 3;
        Console.WriteLine(i + " " + j);
    }
}    
class Program
{
    static void Main(string[] args)
    {
        B obj = new B();
        obj.i = 1;
        obj.j = 2;
        obj.display();     
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
67
Access specifiers which can be used for an interface are?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
68
A class consists of two interfaces with each interface consisting of three methods. The class had no instance data. Which of the following indicates the correct size of object created from this class?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
69
Choose the correct statements among the following:
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?
class overload
{
    public int x;
    int y;
    public int add(int a)
    {
        x = a + 1;
        return x;
    }
    public int add(int a, int b)
    {
        x = a + 2;
        return x;
    }
}    
class Program
{
    static void Main(string[] args)
    {
        overload obj = new overload();
        overload obj1 = new overload();
        int a = 0;
        obj.add(6);
        obj1.add(6, 2);
        Console.WriteLine(obj.x);
        Console.WriteLine(obj1.x);
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board