ExamVeda
Login
Home
51
What will be the output of the following C# code snippet?
public class Generic<T>
{
    Stack<T> stk = new Stack<T>();
    public void push(T obj)
    {
        stk.Push(obj);
    }
    public T pop()
    {
        T obj = stk.Pop();
        return obj;
    }
}
class Program
{
    static void Main(string[] args)
    {
        Generic<string> g = new Generic<string>();
        g.push(30);
        Console.WriteLine(g.pop());
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
52
Choose the exceptions generated by the GetResponseStream() method defined by WebRequest.
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
53
What does the following method specify?
public static WebRequest Create(string requestUriString)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
54
Which of the following is the full form of DNS?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
55
Which of the following class/classes supports the task of uploading and downloading the file?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
56
Which of the following are the classes that support the standard HTTP protocol?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
57
Which of these methods gives the full URL of an URL object?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
58
What does the following C# code block define?
class Gen<T> {  
                 T ob;    
             }
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
59
Which of these is an correct way of defining generic method?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
60
What will be the output of the following C# code?
class Program
{
    static void Main(string[] args)
    {
        int ch;
        HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://www.example.com");
        HttpWebResponse resp = (HttpWebResponse) req.GetResponse();
        Stream istrm = resp.GetResponseStream();
        for (int i = 1 ;  ;i++)
        {
            ch = istrm.ReadByte();
            if (ch == -1) 
            break;
            Console.Write((char)ch);
            if ((i % 400) == 0)
            {
                Console.Write("\nPress Enter.");
                Console.ReadLine();
            }
        }
        resp.Close();
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board