logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Collection Classes See What Others Are Saying!
  • Question
  • A HashTable t maintains a collection of names of states and capital city of each state. Which of the following is the correct way to find out whether "Kerala" state is present in this collection or not?


  • Options
  • A. t.ContainsKey("Kerala");
  • B. t.HasValue("Kerala");
  • C. t.HasKey("Kerala");
  • D. t.ContainsState("Kerala");
  • E. t.ContainsValue("Kerala");

  • Correct Answer
  • t.ContainsKey("Kerala"); 


  • More questions

    • 1. Which of the following is the correct output for the C#.NET program given below?

      int i = 20 ;
      for( ; ; )
      {
          Console.Write(i + " "); 
          if (i >= -10)
              i -= 4; 
          else 
              break;
      }

    • Options
    • A. 20 16 12 84 0 -4 -8
    • B. 20 16 12 8 4 0
    • C. 20 16 12 8 4 0 -4 -8 -12
    • D. 16 12 8 4 0
    • E. 16 8 0 -8
    • Discuss
    • 2. In an inheritance chain which of the following members of base class are accessible to the derived class members?

      1. static
      2. protected
      3. private
      4. shared
      5. public

    • Options
    • A. 1, 3
    • B. 2, 5
    • C. 3, 4
    • D. 4, 5
    • Discuss
    • 3. Which of the following are value types?

      1. Integer
      2. Array
      3. Single
      4. String
      5. Long

    • Options
    • A. 1, 2, 5
    • B. 1, 3, 5
    • C. 2, 4
    • D. 3, 5
    • Discuss
    • 4. Which of the following CANNOT occur multiple number of times in a program?

    • Options
    • A. namespace
    • B. Entrypoint
    • C. Class
    • D. Function
    • E. Subroutine
    • Discuss
    • 5. Which of the following statement correctly assigns a value 33 to a variable c?

      byte a = 11, b = 22, c;


    • Options
    • A. c = (byte) (a + b);
    • B. c = (byte) a + (byte) b;
    • C. c = (int) a + (int) b;
    • D. c = (int)(a + b);
    • E. c = a + b;
    • Discuss
    • 6. An enum can be declared inside a class, struct, namespace or interface.

    • Options
    • A. True
    • B. False
    • Discuss
    • 7. Which of the following statements are correct about the Collection Classes available in Framework Class Library?

    • Options
    • A. Elements of a collection cannot be transmitted over a network.
    • B. Elements stored in a collection can be retrieved but cannot be modified.
    • C. It is not easy to adopt the existing Collection classes for newtype of objects.
    • D. Elements stored in a collection can be modified only if allelements are of similar types.
    • E. They use efficient algorithms to manage the collection, thereby improving the performance of the program.
    • Discuss
    • 8. Which of the following statements is correct about a namespace used in C#.NET?

    • Options
    • A. Nested namespaces are not allowed.
    • B. Importing outer namespace imports inner namespace.
    • C. Nested namespaces are allowed.
    • D. If nested, the namespaces cannot be split across files.
    • Discuss
    • 9. Which of the following does not store a sign?

    • Options
    • A. Short
    • B. Integer
    • C. Long
    • D. Byte
    • E. Single
    • Discuss
    • 10. Which of the following is NOT an Integer?

    • Options
    • A. Char
    • B. Byte
    • C. Integer
    • D. Short
    • E. Long
    • Discuss


    Comments

    There are no comments.

Enter a new Comment