logo

CuriousTab

CuriousTab

Discussion


Home C# Programming .NET Framework See What Others Are Saying!
  • Question
  • Which of the following are parts of the .NET Framework?

    1. The Common Language Runtime (CLR)
    2. The Framework Class Libraries (FCL)
    3. Microsoft Published Web Services
    4. Applications deployed on IIS
    5. Mobile Applications


  • Options
  • A. Only 1, 2, 3
  • B. Only 1, 2
  • C. Only 1, 2, 4
  • D. Only 4, 5
  • E. All of the above

  • Correct Answer
  • Only 1, 2 


  • More questions

    • 1. Which of the following statements are correct about the C#.NET program given below?

      namespace CuriousTabConsoleApplication
      { 
          class SampleProgram
          { 
              static void Main(string[ ] args)
              { 
                  int a = 5;
                  int s = 0, c = 0; 
                  s, c = fun(a); 
                  Console.WriteLine(s +" " + c) ;
              }
              static int fun(int x)
              {
                  int ss, cc;
                  ss = x * x; cc = x * x * x; 
                  return ss, cc;
              } 
          } 
      }
      1. An error will be reported in the statement s, c = fun(a); since multiple values returned from a function cannot be collected in this manner.
      2. It will output 25 125.
      3. It will output 25 0.
      4. It will output 0 125.
      5. An error will be reported in the statement return ss, cc; since a function cannot return multiple values.

    • Options
    • A. 1, 3
    • B. 2, 4
    • C. 4, 5
    • D. 1, 5
    • E. None of these
    • Discuss
    • 2. Which of the following will be the correct output for the C#.NET code snippet given below?

      String s1="Kicit";
      Console.Write(s1.IndexOf('c') + " "); 
      Console.Write(s1.Length);

    • Options
    • A. 3 6
    • B. 2 5
    • C. 3 5
    • D. 2 6
    • E. 3 7
    • Discuss
    • 3. Which of the following is correct way to convert a String to an int?

      1. String s = "123"; 
        int i;
        i = (int)s;
      2. String s = "123";
        int i;
        i = int.Parse(s);
      3. String s = "123"; 
        int i;
        i = Int32.Parse(s);
      4. String s = "123"; 
        int i;
        i = Convert.ToInt32(s);
      5. String s = "123"; 
        int i;
        i = CInt(s);

    • Options
    • A. 1, 3, 5
    • B. 2, 4
    • C. 3, 5
    • D. 2, 3, 4
    • Discuss
    • 4. How will you complete the foreach loop in the C#.NET code snippet given below such that it correctly prints all elements of the array a?

          int[][]a = new int[2][];
          a[0] = new int[4]{6, 1 ,4, 3};
          a[1] = new int[3]{9, 2, 7}; 
          foreach (int[ ] i in a)
          {
              /* Add loop here */
              Console.Write(j + " ");
              Console.WriteLine(); 
          }

    • Options
    • A. foreach (int j = 1; j < a(0).GetUpperBound; j++)
    • B. foreach (int j = 1; j < a.GetUpperBound (0); j++)
    • C. foreach (int j in a.Length)
    • D. foreach (int j in i)
    • E. foreach (int j in a.Length -1)
    • Discuss
    • 5. An Account class has a property called accountNo and acc is a reference to a bank object and we want the C#.NET code snippet given below to work. Which of the following options will ensure this functionality?

      acc.accountNo = 10; 
      Console.WriteLine(acc.accountNo);

    • Options
    • A. Declare accountNo property with both get and set accessors.
    • B. Declare accountNo property with only get accessor.
    • C. Declare accountNo property with get, set and normal accessors.
    • D. Declare accountNo property with only set accessor.
    • E. None of the above
    • Discuss
    • 6. Which of the following statements is correct about an interface?

    • Options
    • A. One interface can be implemented in another interface.
    • B. An interface can be implemented by multiple classes in the same program.
    • C. A class that implements an interface can explicitly implement members of that interface.
    • D. The functions declared in an interface have a body.
    • Discuss
    • 7. Which of the following statements is correct about the C#.NET code snippet given below?

      class Trial
      { 
          int i;
          Decimal d;
      }
      struct Sample
      {
          private int x;
          private Single y;
          private Trial z;
      }
      Sample ss = new Sample();

    • Options
    • A. ss will be created on the heap.
    • B. Trial object referred by z will be created on the stack.
    • C. z will be created on the heap.
    • D. Both ss and z will be created on the heap.
    • E. ss will be created on the stack.
    • Discuss
    • 8. Which of the following snippets are the correct way to convert a Single into a String?

      1. Single f = 9.8f; 
        String s;
        s = (String) (f);
      2. Single f = 9.8f; 
        String s;
        s = Convert.ToString(f);
      3. Single f = 9.8f; 
        String s;
        s = f.ToString();
      4. Single f = 9.8f; 
        String s;
        s = Clnt(f);
      5. Single f = 9.8f; 
        String s;
        s = CString(f);

    • Options
    • A. 1, 2
    • B. 2, 3
    • C. 1, 3, 5
    • D. 2, 4
    • Discuss
    • 9. What will be the output of the C#.NET code snippet given below?

      int num = 1, z = 5;
      
      if (!(num <= 0))
          Console.WriteLine( ++num + z++ + " " + ++z ); 
      else
          Console.WriteLine( --num + z-- + " " + --z ); 

    • Options
    • A. 5 6
    • B. 6 5
    • C. 6 6
    • D. 7 7
    • Discuss
    • 10. Which of the following statements is correct?

    • Options
    • A. When used as a modifier, the new keyword explicitly hides a member inherited from a base class.
    • B. Operator overloading works in different ways for structures and classes.
    • C. It is not necessary that all operator overloads are static methods of the class.
    • D. The cast operator can be overloaded.
    • Discuss


    Comments

    There are no comments.

Enter a new Comment