Why do we use generic in c#?

Forums C#Why do we use generic in c#?
Staff asked 2 years ago

Why do we use generic in c#?

Answers (1)

Add Answer
Umang Ramani Marked As Accepted
Staff answered 2 years ago

Generic refers to the overall form, not the specific form. In C#, generic implies not tied to a specific data type.

Using the type parameter and without the specific data type, you may construct generic classes, interfaces, abstract classes, fields, methods, static methods, properties, events, delegates, and operators. A type parameter is a placeholder for a specific type that is given when building a generic type instance.

Subscribe

Select Categories