1.

Which of these type parameters is used for a generic methods to return and accept any type of object?(a) K(b) N(c) T(d) VThis question was posed to me during an interview for a job.I'd like to ask this question from Generic Methods topic in chapter Generics of Java

Answer»

Right option is (C) T

Explanation: T is USED for type, A type variable can be any non-primitive type you specify: any class type, any interface type, any ARRAY type, or EVEN another type variable.



Discussion

No Comment Found

Related InterviewSolutions