CSE MCQs :: Java Generics
- Which of these type parameters is used for a generic class to return and accept a number?
- Which of the following is incorrect statement regarding the use of generics and parameterized types in Java?
- Which of the following allows us to call generic methods as a normal method?
- Why are generics used?
- Which of the following is Faster, StringBuilder or StringBuffer?
- Which of the following reference types cannot be generic?
- Which of these types cannot be used to initiate a generic type?
- Which of these instances cannot be created?
A.
Generics provide type safety by shifting more type checking responsibilities to the compiler
|
B.
Generics and parameterized types eliminate the need for down casts when using Java Collections
|
C.
When designing your own collections class (say, a linked list), generics and parameterized types allow you to achieve type safety with just a single class definition as opposed to defining multiple classes
|
D.
All of the mentioned
|