adplus-dvertising
frame-decoration

Question

Which of these is an 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} { /* … */ }

Posted under C# programming

Answer: (b).public name { /* … */ }

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of these is an correct way of defining generic method?