ExamVeda
Login
Home
11
Which keyword is used for using the synchronization features defined by the Monitor class?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
12
What will be the output of the following C# code snippet?
class UnsafeCode
{
    unsafe static void Main()
    {
        int[] nums = new int[10];
        fixed (int* p = &nums[0], p2 = nums)
        {
            if (p == p2)
            Console.WriteLine("p and p2 point to same address.");
            Console.ReadLine();
        }
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
13
Which among the following is the correct way to access all the elements of the Stack collection created using the C#.NET code snippet given below?
Stack st = new Stack();
st.Push(10);
st.Push(20);
st.Push(-5);
st.Push(30);
st.Push(6);
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
14
What will be the output of the following C# code snippet?
class UnsafeCode
{
    static void Main()
    {
        int count = 100;
        int? result = null;
        int incr = 10;
        result = count + incr;
        if (result.HasValue)
            Console.WriteLine("result has this value: " + result.Value);
        else
            Console.WriteLine("result has no value");
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
15
What will be the output of the following C# code snippet?
class Program
{
    static void Main(string[] args)
    {
        int[] nums = { 1 };
        var posNums = from n in nums
                      select Math.Pow(4 ,3);
        Console.Write("The values in nums: ");
        foreach (int i in posNums) 
        Console.Write(i + " ");
        Console.WriteLine();
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
16
What will be the output of the following C# code snippet?
class access
{
    public int x;
    private int y;
    public  void cal(int a, int b)
    {
        x = a + 1;
        y = b;
    }
}    
class Program
{
    static void Main(string[] args)
    {
        access obj = new access();   
        obj.cal(2, 3);
        Console.WriteLine(obj.x + " " + obj.y);     
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
17
What will be the output of the following C# code snippet?
class UnsafeCode
{
    unsafe static void Main()
    {
        char[] arr = { 'A', 'B', 'C', 'D', 'E' };
        fixed (char* P = arr)
        {
            int i;
            for (i = 0 ;i < 5 ;i++)
            if (*P % 2 == 0)
            ++*P;
            else
            (*P)++;
            Console.WriteLine(arr);
        }
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
18
Which of these method of class String is used to obtain length of String object?
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 snippet?
class Program
{
    static void Main(string[] args)
    {
        String s1 = "Hello i love Csharp";
        StringBuilder s2 = new  StringBuilder(s1);
        Console.WriteLine(s1.Equals(s2));
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
20
A HashTable t maintains a collection of names of states and capital city of each state. Which among the following finds out whether "New delhi" state is present in the collection or not?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board