ExamVeda
Login
Home
91
What will be the output of the following C# code?
interface i1
{
    void f1();
}
interface i2 :i1
{
    void f2();
}
public class maths :i2
{
    public void f2()
    {
        Console.WriteLine("fun2");
    }
    public void f1()
    {
        Console.WriteLine("fun1");
    }
}
class Program
{
    static Void Main()
    {
        maths m = new maths();
        m.f1();
        m.f2();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
92
What will be the output of the following C# code?
namespace ConsoleApplication4
{   
    abstract class A 
    {
        public int i;
        public abstract void display();
    }    
    class B: A 
    {
        public  int j;
        public int sum;
        public override void display() 
        {
            sum = i + j;
            Console.WriteLine(+i + "\n" + +j);
            Console.WriteLine("sum is:" +sum);
        }
    }    
    class Program
    {
        static void Main(string[] args)
        {
            A obj = new B();
            obj.i = 2;
            B obj1 = new B();
            obj1.j = 10;
            obj.display();
            Console.ReadLine();
        }
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
93
The process of defining two or more methods within the same class that have same name but different parameters list?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
94
What will be the output of the following C# code?
 class maths
 {
     public int length;
     public int breadth;
     public maths(int x, int y)
     {
         length = x;
         breadth = y;
         Console.WriteLine(x + y);
     }
     public maths(double x, int y)
     {
         length = (int)x;
         breadth = y;
         Console.WriteLine(x * y);
     }
 }
class Program
{
    static void Main(string[] args)
    {
        maths m = new maths(20, 40);
        maths k = new maths(12.0, 12);
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
95
What will be the output of the following C# code?
static void Main(string[] args)
{
    int x = 4 ,b = 2;
    x -= b/= x * b;
    Console.WriteLine(x + " " + b);
    Console.ReadLine();
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
96
Which of these keywords is used to refer to member of base class from a sub class?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
97
Which of the following functionality is facilitated by inheritance mechanism?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
98
What is the process of defining a method in terms of itself, that is a method that calls itself?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
99
Which keyword is used to declare a base class method while performing overriding of base class methods?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
100
What will be the output of the following C# code?
class z
{
    public string name1;
    public string address;
    public void show()
    {
        Console.WriteLine("{0} is in city{1}", name1, " ", address);
    }
}
class Program
{
    static void Main(string[] args)
    {
        z n = new z();
        n.name1 = "harsh";
        n.address = "new delhi";
        n.show();
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board