logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Generics See What Others Are Saying!
  • Question
  • Which one of the following classes are present System.Collections.Generic namespace?

    1. Stack
    2. Tree
    3. SortedDictionary
    4. SortedArray


  • Options
  • A. 1 and 2 only
  • B. 2 and 4 only
  • C. 1 and 3 only
  • D. All of the above
  • E. None of the above

  • Correct Answer
  • 1 and 3 only 


  • More questions

    • 1. The this reference gets created when a member function (non-shared) of a class is called.

    • Options
    • A. True
    • B. False
    • Discuss
    • 2. Which of the following statements is correct about Bitwise | operator used in C#.NET?

    • Options
    • A. The | operator can be used to put OFF a bit.
    • B. The | operator can be used to Invert a bit.
    • C. The | operator can be used to check whether a bit is ON.
    • D. The | operator can be used to check whether a bit is OFF.
    • E. The | operator can be used to put ON a bit.
    • Discuss
    • 3. Which of the following statements is correct about the C#.NET code snippet given below?

      int d; 
      d = Convert.ToInt32( !(30 < 20) );

    • Options
    • A. A value 0 will be assigned to d.
    • B. A value 1 will be assigned to d.
    • C. A value -1 will be assigned to d.
    • D. The code reports an error.
    • E. The code snippet will work correctly if ! is replaced by Not.
    • Discuss
    • 4. Which of the following will be the correct output for the C#.NET code snippet given below?

      String s1 = "Nagpur";
      String s2;
      s2 = s1.Insert(6, "Mumbai"); 
      Console.WriteLine(s2);

    • Options
    • A. NagpuMumbair
    • B. Nagpur Mumbai
    • C. Mumbai
    • D. Nagpur
    • E. NagpurMumbai
    • Discuss
    • 5. What will be the output of the C#.NET code snippet given below?

      namespace CuriousTabConsoleApplication
      {
          class SampleProgram
          {
              static void Main(string[ ] args)
              {
                  string str= "Hello World!";
                  Console.WriteLine( String.Compare(str, "Hello World?" ).GetType() );
              }
          }
      }

    • Options
    • A. 0
    • B. 1
    • C. String
    • D. Hello World?
    • E. System.Int32
    • Discuss
    • 6. If a namespace is present in a library then which of the following is the correct way to use the elements of the namespace?

    • Options
    • A. Add Reference of the namespace.
      Use the elements of the namespace.
    • B. Add Reference of the namespace.
      Import the namespace.
      Use the elements of the namespace.
    • C. Import the namespace.
      Use the elements of the namespace.
    • D. Copy the library in the same directory as the project that is trying to use it.
      Use the elements of the namespace.
    • E. Install the namespace in Global Assembly Cache.
      Use the elements of the namespace.
    • Discuss
    • 7. How many bytes will the structure variable samp occupy in memory if it is defined as shown below?

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

    • Options
    • A. 20 bytes
    • B. 12 bytes
    • C. 8 bytes
    • D. 16 bytes
    • E. 24 bytes
    • Discuss
    • 8. Which of the following statements are correct?

      1. Instance members of a class can be accessed only through an object of that class.
      2. A class can contain only instance data and instance member function.
      3. All objects created from a class will occupy equal number of bytes in memory.
      4. A class can contain Friend functions.
      5. A class is a blueprint or a template according to which objects are created.

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

      class Student s1, s2; // Here 'Student' is a user-defined class.
      s1 = new Student(); 
      s2 = new Student();

    • Options
    • A. Contents of s1 and s2 will be exactly same.
    • B. The two objects will get created on the stack.
    • C. Contents of the two objects created will be exactly same.
    • D. The two objects will always be created in adjacent memory locations.
    • E. We should use delete() to delete the two objects from memory.
    • Discuss
    • 10. Is it possible for you to prevent an object from being created by using zero argument constructor?

    • Options
    • A. Yes
    • B. No
    • Discuss


    Comments

    There are no comments.

Enter a new Comment