Chapter 7 Generics MCQs 14 min Score: 0 Attempted: 0/14 Subscribe 1. . Which of the following allows us to call generic methods as a normal method? (A) Interface (B) Type Interface (C) Inner class (D) All of the mentionedShow All Answers 2. . Which of these type parameters is used for a generic class to return and accept a number? (A) N (B) K (C) T (D) VShow All Answers 3. . Which of these type parameters is used for a generic method to return and accept any type of object? (A) K (B) T (C) N (D) VShow All Answers 4. . Which of the following is faster, StringBuilder or StringBuffer? (A) Both of the above (B) StringBuffer (C) StringBuilder (D) None of the aboveShow All Answers 5. . What are generic methods? (A) Generic methods are the methods defined in a generic class (B) Generic methods are methods that introduce their own type parameters (C) Generic methods are the methods that extend generic class methods (D) Generic methods are methods that take void parametersShow All Answers 6. . Which of the following cannot be type parameterized? (A) Overloaded Methods (B) Generic methods (C) Class methods (D) Overriding methodsShow All Answers 7. . Which of these exception handlers cannot be type parameterized? (A) catch (B) all of the mentioned (C) throws (D) throwShow All Answers 8. . What is meant by the term generics? (A) parameterized types (B) class (C) structure (D) interfaceShow All Answers 9. . Are generics in C# the same as the generics in Java and templates in C++? (A) Yes (B) May be (C) No (D) None of the mentionedShow All Answers 10. . Choose the advantages of using generics? (A) Generics facilitate type safety (B) Generics facilitate improved performance and reduced code (C) Generics promote the usage of parameterized types (D) All of the mentionedShow All Answers 11. . Which of these is a correct way of defining a generic method? (A) public name { / … / } (B) name(T1, T2, …, Tn) { /* … / } (C) class name[T1, T2, ..., Tn] { / … / } (D) name{T1, T2, …, Tn} { / … */ }Show All Answers 12. . Which of the following types of reference cannot be generic? (A) Inner classes (B) Interface (C) Inner class anonymous (D) All the answers are trueShow All Answers 13. . Which of these types cannot be used to initiate a generic type? (A) Integer class (B) Float class (C) Collections (D) Primitive TypesShow All Answers 14. . Which of this instance cannot be created? (A) Generic type instance (B) Generic class instance (C) Integer instance (D) Collection instancesShow All Answers