logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Namespaces See What Others Are Saying!
  • Question
  • Which of the following is NOT a namespace in the .NET Framework Class Library?


  • Options
  • A. System.Process
  • B. System.Security
  • C. System.Threading
  • D. System.Drawing
  • E. System.Xml

  • Correct Answer
  • System.Process 


  • More questions

    • 1. What will be the output of the C#.NET code snippet given below?

      char ch = Convert.ToChar ('a' | 'b' | 'c'); 
      switch (ch)
      {
          case 'A': 
          case 'a':
          Console.WriteLine ("case A | case a");
          break;
          
          case 'B': 
          case 'b':
          Console.WriteLine ("case B | case b");
          break;
          
          case 'C':
          case 'c':
          case 'D':
          case 'd':
          Console.WriteLine ("case D | case d");
          break;
      }

    • Options
    • A. case A | case a
    • B. case B | case b
    • C. case D | case d
    • D. Compile Error
    • E. No output
    • Discuss
    • 2. Which of the following statements is correct about the C#.NET code snippet given below?

      int i, j, id = 0; switch (id)
      { 
          case i:
              Console.WriteLine("I am in Case i");
              break; 
          
          case j:
              Console.WriteLine("I am in Case j");
              break;
      }

    • Options
    • A. The compiler will report case i and case j as errors since variables cannot be used in cases.
    • B. Compiler will report an error since there is no default case in the switch case statement.
    • C. The code snippet prints the result as "I am in Case i"".
    • D. The code snippet prints the result as "I am in Case j".
    • E. There is no error in the code snippet.
    • Discuss
    • 3. Which of the following statements is correct?

    • Options
    • A. Information is never lost during narrowing conversions.
    • B. The CInteger() function can be used to convert a Single to an Integer.
    • C. Widening conversions take place automatically.
    • D. Assigning an Integer to an Object type is known as Unboxing.
    • E. 3.14 can be treated as Decimal by using it in the form 3.14F.
    • Discuss
    • 4. Which of the following benefits do we get on running managed code under CLR?

      1. Type safety of the code running under CLR is assured.
      2. It is ensured that an application would not access the memory that it is not authorized to access.
      3. It launches separate process for every application running under it.
      4. The resources are Garbage collected.

    • Options
    • A. Only 1 and 2
    • B. Only 2, 3 and 4
    • C. Only 1, 2 and 4
    • D. Only 4
    • E. All of the above
    • Discuss
    • 5. Which of the following statements is correct about the C#.NET code snippet given below?

      namespace CuriousTabConsoleApplication
      { 
          class Sample
          { 
              public int func()
              {
                  return 1;
              } 
              public Single func()
              { 
                  return 2.4f ;
              } 
          } 
          class Program
          { 
              static void Main(string[ ] args)
              {
                  Sample s1 = new Sample(); 
                  int i;
                  i = s1.func(); 
                  Single j; 
                  j = s1.func(); 
              } 
          } 
      }

    • Options
    • A. func() is a valid overloaded function.
    • B. Overloading works only in case of subroutines and not in case of functions.
    • C. func() cannot be considered overloaded because: return value cannot be used to distinguish between two overloaded functions.
    • D. The call to i = s1.func() will assign 1 to i.
    • E. The call j = s1.func() will assign 2.4 to j.
    • Discuss
    • 6. What will be the output of the C#.NET code snippet given below?

      namespace CuriousTabConsoleApplication
      {
          class SampleProgram
          {
              static void Main(string[ ] args)
              {
                  int i, j;
                  int[ , ] arr = new int[ 2, 2 ];
                  for(i = 0; i < 2; ++i)
                  {
                      for(j = 0; j < 2; ++j)
                      {
                          arr[i, j] = i * 17 + i * 17;
                          Console.Write(arr[ i, j ] + " ");
                      }
                  }
              }
          }
      }

    • Options
    • A. 0 0 34 34
    • B. 0 0 17 17
    • C. 0 0 0 0
    • D. 17 17 0 0
    • E. 34 34 0 0
    • Discuss
    • 7. Which of the following is the correct way to rewrite the following C#.NET code snippet given below?

      int i = 0; 
      do
      {
          Console.WriteLine(i);
          i+ = 1; 
      } while (i <= 10);

    • Options
    • A.
      int i = 0; 
      do
      {
          Console.WriteLine(i);
      } until (i <= 10);
    • B.
      int i;
      for (i = 0; i <= 10 ; i++)
          Console.WriteLine(i);
    • C.
      int i = 0; 
      while (i <= 11)
      {
          Console.WriteLine(i);
          i += 1; 
      }
    • D.
      int i = 0;
      do while ( i <= 10)
      {
          Console.WriteLine(i); 
          i += 1;
      }
    • E.
      int i = 0;
      do until (i <= 10)
      {
          Console.WriteLine(i);
          i+=1; 
      }
    • Discuss
    • 8. The C#.NET code snippet given below generates ____ numbers series as output?

      int i = 1, j = 1, val;
      while (i < 25)
      {
          Console.Write(j + " ");
          val = i + j;
          j = i;
          i = val;
      }

    • Options
    • A. Prime
    • B. Fibonacci
    • C. Palindrome
    • D. Odd
    • E. Even
    • Discuss
    • 9. The way a derived class member function can access base class public members, the base class member functions can access public member functions of derived class.

    • Options
    • A. True
    • B. False
    • Discuss
    • 10. Which of the following statements are correct about functions and subroutines used in C#.NET?

      1. A function cannot be called from a subroutine.
      2. The ref keyword causes arguments to be passed by reference.
      3. While using ref keyword any changes made to the parameter in the method will be reflected in that variable when control passes back to the calling method.
      4. A subroutine cannot be called from a function.
      5. Functions and subroutines can be called recursively.

    • Options
    • A. 1, 2, 4
    • B. 2, 3, 5
    • C. 3, 5
    • D. 4, 5
    • E. None of these
    • Discuss


    Comments

    There are no comments.

Enter a new Comment