ExamVeda
Login
Home
51
What will be the output of the following C# code?
class A
{
    public int i;
    private int j;
}     
class B :A 
{
    void display() 
    {
        base.j = base.i + 1;
        Console.WriteLine(base.i + "  " + base.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
52
Which of the given modifiers can be used to prevent Method overriding?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
53
Which of the following keyword is used to change data and behavior of a base class by replacing a member of the base class with a new derived member?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
54
Choose the wrong statement about 'INTERFACE' in C#.NET?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
55
Selecting appropriate method out of number of overloaded methods by matching arguments in terms of number, type and order and binding that selected method to object at compile time is called?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
56
If no access modifier for a class is specified, then class accessibility is defined as?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
57
What will be the output of the following C# code?
static void Main(string[] args)
{
    int a = 5;
    int s = 0, c = 0;
    Mul (a, ref s, ref c);
    Console.WriteLine(s + "t " +c);
    Console.ReadLine();
}
static void Mul (int x, ref int ss, ref int cc)
{
    ss = x * x;
    cc = x * x * x;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
58
Number of constructors a class can define is?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
59
Correct way to overload +operator?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
60
The data members of a class by default are?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board