a) class name(T1, T2, …, Tn) { /* … */ }
b) class name<T1, T2, …, Tn> { /* … */ }
c) class name[T1, T2, …, Tn] { /* … */ }
d) class name{T1, T2, …, Tn} { /* … */ }
1 thought on “Which of these is an correct way of defining generic class?”
Leave a Comment
You must be logged in to post a comment.
b
Explanation: The type parameter section, delimited by angle brackets (<>), follows the class name. It specifies the type parameters (also called type variables) T1, T2, …, and Tn.