Sail E0 Webinar

MCQs

Total Questions : 10
Question 1. How many ports of TCP/IP are reserved for specific protocols?
  1.    10
  2.    1024
  3.    2048
  4.    512
 Discuss Question
Answer: Option B. -> 1024




Question 2. What will be the output of the program?class box {    int width;    int height;    int length;    int volume;    void volume(int height, int length, int width)     {        volume = width * height * length;    } }    class Prameterized_method{    public static void main(String args[])     {       box obj = new box();       obj.height = 1;       obj.length = 5;       obj.width = 5;       obj.volume(3, 2, 1);       Console.WriteLine(obj.volume);         Console.ReadLine();          } }
  1.    0
  2.    1
  3.    6
  4.    25
 Discuss Question
Answer: Option C. -> 6




Question 3. What will be the output of following code snippet?#define pi  using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;  namespace ConsoleApplication13{    class Program    {           static void Main(string[] args)        {            #if (!pi)             Console.WriteLine("i");            #else             Console.WriteLine("pi not define");            #endif            Console.WriteLine("ok");            Console.ReadLine();       }   }}
  1.    ipi not define
  2.    pi not defineok
  3.    iok
  4.    ok
 Discuss Question
Answer: Option B. -> pi not defineok




Question 4. Which among the following statements are not correct about a namespace used in C#.NET?
  1.    Nested namespaces are allowed
  2.    Importing outer namespaces imports inner namespace
  3.    Nested namespaces are allowed
  4.    Importing outer namespace does not import inner namespace
 Discuss Question
Answer: Option B. -> Importing outer namespaces imports inner namespace




Question 5. Select the properties related to the network errors generated by WebException:
  1.    Response
  2.    get
  3.    set
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Response


WebException has two properties that relate to network errors:
Response and Status.
We can obtain a reference to the WebResponse object inside an exception handler through the Response property. For the HTTP protocol, this object describes the error. It is defined like this: public WebResponse Response { get; }
When an error occurs, we can use the Status property of WebException to find out what went wrong. It is defined like this:
public WebExceptionStatus Status {get; }


Question 6. Which among the following is a .NET namespace?
  1.    System.Web
  2.    System.Process
  3.    System.Drawing2D
  4.    System.Drawing3D
 Discuss Question
Answer: Option A. -> System.Web




Question 7. What will be the output of following code snippet?#define DEBUG #define MYTESTusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace ConsoleApplication13{    class Program    {           static void Main(string[] args)        {            #if (DEBUG && !MYTEST)            Console.WriteLine("DEBUG is defined");            #elif (!DEBUG && MYTEST)            Console.WriteLine("MYTEST is defined");            #elif (DEBUG && MYTEST)            Console.WriteLine("DEBUG and MYTEST are defined");            #else            Console.WriteLine("DEBUG and MYTEST are not defined");            #endif            Console.ReadLine();        }    }}
  1.    DEBUG is definedMYTEST is defined
  2.    MYTEST is definedDEBUG and MYTEST are defined
  3.    DEBUG and MYTEST are not definedMYTEST is defined
  4.    DEBUG and MYTEST are defined
 Discuss Question
Answer: Option D. -> DEBUG and MYTEST are defined




Question 8. How many bits are present in a single IP address?
  1.    8
  2.    16
  3.    32
  4.    64
 Discuss Question
Answer: Option C. -> 32




Question 9. What does the following code block define? class Gen {                    T ob;                  }
  1.    Generics class decleration
  2.    Decleration of variable
  3.    a simple class decleration
  4.    Both a & b
 Discuss Question
Answer: Option D. -> Both a & b


class Gen This defines the generics declaration where 'T' is the name of type parameter.This parameter is used as a placeholder for the actual type that will be specified when a Gen object is created.Gen is a generic class . T is used to declare a variable called 'ob'.


Question 10. What does the following method specify?public static WebRequest Create(string requestUriString)
  1.    Creates a WebRequest object for the URI specified by the string passed by requestUriString
  2.    The object returned will implement the protocol specified by the prefix of the URI
  3.    The object will be an instance of the class that inherits WebRequest
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


Creates a WebRequest object for the URI specified by the string passed by requestUriString. The object returned will
implement the protocol specified by the prefix of the URI.Thus, the object will be an instance of a class that inherits WebRequest. A NotSupportedException is thrown if the requested protocol is not available. A UriFormatException is thrown if the URI format is invalid.


Latest Videos

Latest Test Papers