logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Collection Classes See What Others Are Saying!
  • Question
  • In which of the following collections is the Input/Output index-based?

    1. Stack
    2. Queue
    3. BitArray
    4. ArrayList
    5. HashTable


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

  • Correct Answer
  • 3 and 4 only 


  • More questions

    • 1. Which of the following statements is valid about advantages of generics?

    • Options
    • A. Generics shift the burden of type safety to the programmer rather than compiler.
    • B. Generics require use of explicit type casting.
    • C. Generics provide type safety without the overhead of multiple implementations.
    • D. Generics eliminate the possibility of run-time errors.
    • E. None of the above.
    • Discuss
    • 2. Which of the following is the correct way to implement a read only property Length in a Sample class?

    • Options
    • A.
      class Sample
      {
          int len;
          public int Length
          {
              get
              {
                  return len;
              } 
          } 
      }
    • B.
      class Sample
      {
          public int Length
          {
              get
              {
                  return Length;
              } 
          } 
      }
    • C.
      class Sample
      {
          int len;
          public int Length
          {
              get
              {
                  return len;
              } 
              set
              {
                  len = value;
              } 
          } 
      }
    • D.
      class Sample
      {
          int len;
          public int Length
          {
              Readonly get
              {
                  return len;
              } 
          } 
      }
    • Discuss
    • 3. Which of the following are necessary for Run-time Polymorphism?

      1. The overridden base method must be virtual, abstract or override.
      2. Both the override method and the virtual method must have the same access level modifier.
      3. An override declaration can change the accessibility of the virtual method.
      4. An abstract inherited property cannot be overridden in a derived class.
      5. An abstract method is implicitly a virtual method.

    • Options
    • A. 1, 3
    • B. 1, 2, 5
    • C. 2, 3, 4
    • D. 4 only
    • Discuss
    • 4. If s1 and s2 are references to two strings then which of the following are the correct ways to find whether the contents of the two strings are equal?

      1. if(s1 = s2)
      2. if(s1 == s2)
      3. int c;
        c = s1.CompareTo(s2);
      4. if( strcmp(s1, s2) )
      5. if (s1 is s2)

    • Options
    • A. 1, 2
    • B. 2, 3
    • C. 4, 5
    • D. 3, 5
    • Discuss
    • 5. Which of the following statements are correct about exception handling in C#.NET?

      1. If our program does not catch an exception then the .NET CLR catches it.
      2. It is possible to create user-defined exceptions.
      3. All types of exceptions can be caught using the Exception class.
      4. CLRExceptions is the base class for all exception classes.
      5. For every try block there must be a corresponding finally block.

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

          int[] intMyArr = {11, 3, 5, 9, 4}; 

    • Options
    • A. intMyArr is a reference to an object of System.Array Class.
    • B. intMyArr is a reference to an object of a class that the compiler derives from System.Array Class.
    • C. intMyArr is a reference to an array of integers.
    • D. intMyArr is a reference to an object created on the stack.
    • E. intMyArr is a reference to the array created on the stack.
    • Discuss
    • 7. Which of the following statements are correct about the this reference?

      1. this reference can be modified in the instance member function of a class.
      2. Static functions of a class never receive the this reference.
      3. Instance member functions of a class always receive a this reference.
      4. this reference continues to exist even after control returns from an instance member function.
      5. While calling an instance member function we are not required to pass the this reference explicitly.

    • Options
    • A. 1, 4
    • B. 2, 3, 5
    • C. 3, 4
    • D. 2, 5
    • E. None of these
    • Discuss
    • 8. A property can be declared inside a class, struct, Interface.

    • Options
    • A. True
    • B. False
    • Discuss
    • 9. Which of the following statements is correct about an interface used in C#.NET?

    • Options
    • A. One class can implement only one interface.
    • B. In a program if one class implements an interface then no other class in the same program can implement this interface.
    • C. From two base interfaces a new interface cannot be inherited.
    • D. Properties can be declared inside an interface.
    • E. Interfaces cannot be inherited.
    • Discuss
    • 10. Which of the following utilities can be used to compile managed assemblies into processor-specific native code?

    • Options
    • A. gacutil
    • B. ngen
    • C. sn
    • D. dumpbin
    • E. ildasm
    • Discuss


    Comments

    There are no comments.

Enter a new Comment