Which of these is a correct way of defining generic method?

a) name(T1, T2, …, Tn) { /* … */ }
b) public name { /* … */ }
c) class name[T1, T2, …, Tn] { /* … */ }
d) name{T1, T2, …, Tn} { /* … */ }

1 thought on “Which of these is a correct way of defining generic method?”

  1. b
    Explanation: The syntax for a generic method includes a type parameter, inside angle brackets, and appears before the method’s return type. For static generic methods, the type parameter section must appear before the method’s return type.

Leave a Comment