Why do we use generic in c#?

Forums C#Why do we use generic in c#?
Staff asked 1 month ago

Why do we use generic in c#?

Answers (1)

Add Answer
Staff answered 1 month 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