ExamVeda
Login
Home
1
If a class inheriting an abstract class does not define all of its functions then it is known as?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
2
What will be the output of the following C# code?
namespace ConsoleApplication4
{
    class A
    {
        public int i;
        public void display()
        {
            Console.WriteLine(i);
        }
    }    
    class B: A 
    {
        public int j;
        public void display() 
        {
            Console.WriteLine(j);
        }
    }    
    class Program
    {
        static void Main(string[] args)
        {
            B obj = new B();
            obj.j = 1;
            obj.i = 8;
            obj.display();
            Console.ReadLine();
        }
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
3
What will be the output of the following C# code?
 enum per
{
    a, 
    b, 
    c, 
    d, 
}
per.a = 10;
Console.writeline(per.b);
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
4
What will be the output of the following C# code?
class sample
{
    public sample()
    {
        Console.WriteLine("THIS IS BASE CLASS constructor");
    }
 }    
public class sample1 : sample 
{
 
}    
class Program
{
    static void Main(string[] args)
    {
        sample1 obj = new sample1();
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
5
Select the wrong statements among the following?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
6
What will be the output of the following C# code?
class maths
{
    public int x;
    public double y;
    public int add(int a, int b)
    {
        x = a + b;
        return x;
    }
    public int add(double c, double d)
    {
        y = c + d;
        return (int)y;
    }
    public maths()
    {
        this.x = 0;
        this.y = 0;
    }
}    
class Program
{
    static void Main(string[] args)
    {
        maths obj = new maths();
        int a = 4;
        double b = 3.5;
        obj.add(a, a);
        obj.add(b, b);
        Console.WriteLine(obj.x + " " + obj.y);
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
7
What will be the Correct statement in the following C# code?
interface a1
{
    void f1();
    int f2();
}
class a :a1
{
    void f1()
    {
    }
    int a1.f2()
    {
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
8
Which of the following statements are correct in nature?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
9
Which form of inheritance is not supported directly by C# .NET?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
10
What will be the output of the following C# code snippet?
class maths
{
    public int fact(int n)
    {
        int result;
        if (n == 2)
        return 1;
        result = fact(n - 1) * n;
        return result;
    }
} 
class Program
{
    static void Main(string[] args)
    {            
        maths obj = new maths();
        Console.WriteLine(obj.fact(4));
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board