ExamVeda
Login
Home
71
If math class had add property with get and set accessors, then which of the following statements will work correctly?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
72
Which of these clauses will be executed even if no exceptions are found?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
73
Choose the statements which makes use of essential properties rather than making data member public in C#.NET?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
74
What will be the output of the following C# code?
class Program
{
     static void Main(string[] args)
     {            
         try 
         {
             Console.WriteLine("csharp" + " " + 1/0);
         }
         finally
         {
             Console.WriteLine("Java");        	
         }
         Console.ReadLine();
     }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
75
What will be the output of the following C# code?
{
    int sum = 10;
    try
    {
        int i;
        for (i = -1; i < 3; ++i)
        sum = (sum / i);
    }
    catch (ArithmeticException e)
    {
        Console.WriteLine("0");
    }
    Console.WriteLine(sum);
    Console.ReadLine();
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
76
What will be the output of the following C# code?
class number
{
    private int num1;
    private int num2;
    public int anumber
    {
        get
        {
            return num1;
        }
        set
        {
            num1 = value;
        }
    }
    public int anumber1
    {
        get
        {
            return num2;
        }
        set
        {
            num2 = value;
        }
    }
}
class Program
{
    public static void Main(string[] args)
    {
        number p = new number();
        p.anumber = 20;
        number k = new number();
        k.anumber1 = 40; 
        int m = p.anumber;
        int t = k.anumber1;
        int r = p.anumber + k.anumber1;
        System.Console.WriteLine("number1 = " +m);
        System.Console.WriteLine("number2 = " +t);
        System.Console.WriteLine("sum = " +r);
        System.Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
77
Choose the correct statement among the followings?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
78
What will be the output of the following C# code?
class list
{
    ArrayList array = new ArrayList();
    public object this[int index]
    {
        get
        {
            if (index < 0 || index >= array.Count)
            {
                return null;
            }
            else
            {
                return (array[index]);
            }
        }
        set
        {
            array[index] = value;
        }
    }
    public int Count 
   { 
       get;
       set; 
   }
}
class Program
{
    static void Main(string[] args)
    {
        list list1 = new list();
        list1[0] = "123";
        list1[1] = " abc ";
        list1[2] = "xyz";
        for (int i = 0; i<=list1.Count; i++)
        Console.WriteLine(list1[i]);
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
79
If the math class had add property with get accessors then which of the following statements will work correctly?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
80
What will be the output of the following C# code?
class number
{
    private int num1 = 60;
    private int num2 = 20;
    public int anumber
    {
        get
        {
            return num1;
        }
        set
        {
            num1 = value;
        }
    }
    public int anumber1
    {
        get
        {
            return num2;
        }
        set
        {
            num2 = value;
        }
    }
}
class Program
{
    public static void Main(string[] args)
    {
        number p = new number();
        number k = new number();
        int m = p.anumber;
        int t = k.anumber1;
        int r = p.anumber * k.anumber1;
        Console.WriteLine("sum = " + r);
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board