ExamVeda
Login
Home
11
Name a method which has the same name as that of class and which is used to destroy objects also called automatically when application is finally on process of being getting terminated.
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
12
Which statements are correct about operator overloading?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
13
Choose the wrong statement from the given set of statements?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
14
What will be the output of the following C# code?
interface calc
{
    void cal(int i);
}
public  class maths :calc 
{
    public int x;
    public void cal(int i) 
    {
        x = i * i;            
    }
}
class Program
{
    public static void Main(string[] args)
    {            
        display arr = new display();
        arr.x = 0;      
        arr.cal(2);
        Console.WriteLine(arr.x);
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
15
What will be the output of the following C# code?
enum color:int
{
    red,
    green,
    blue = 5,
    cyan,
    pink = 10,
    brown
}
console.writeline((int)color.green);
console.writeline((int)color.brown);
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
16
What will be the output of the following C# code?
class maths
{
    int i;
    public  maths(int ii)
    {
        ii = -25;
        int g;
        g = ii > 0 ? ii : ii * -1;
        Console.WriteLine(g);
    }
}
class maths1 :maths
{
    public  maths1(int ll) :base(ll)
    {
        ll = -1000;
        Console.WriteLine((ll > 0 ? ll : ll * -1));
    }
}
class Program
{
    static void Main(string[] args)
    {
        maths1 p = new maths1(6);
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
17
Operators that can be overloaded are?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
18
Which of the following cannot be used to declare a class as a virtual?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
19
What will be the output of the following C# code?
class maths
{
    public static void fun1()
    {
        Console.WriteLine("method 1 :");
    }
    public void fun2()
    {
        fun1();
        Console.WriteLine("method 2 :");
    }
    public void fun2(int k)
    {
        Console.WriteLine(k);
        fun2();
    }
}    
class Program
{
    static void Main(string[] args)
    {
        maths obj = new maths();
        maths.fun1();
        obj.fun2(20);
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
20
What will be the output of the following C# code?
static void Main(string[] args)
{
    int a = 10 , b = 20;
    Console.WriteLine("Result before swap is: "+ a +" "+b);
    swap(ref a, ref b);
    Console.ReadLine();
}
static void swap(ref int i, ref int j)
{
    int t;
    t = i;
    i = j;
    j = t;
    Console.WriteLine("Result after swap is:"+ i +" "+j);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board