Qus:    What is the purpose of Generics?
Nov 24, 2020 14:15 2 Answers Views: 94 SAI

 



Generic types to maximize code re-usability, type safety, and performance. The main common use of generics is to create collection classes. The .NET Framework class library contains many new generic collection classes in the

System Collections. Generic namespace. These can be used whenever possible instead of classes such as Array List in the System. Collections namespace. We can create our own generic interfaces, classes, methods, events and delegates. Generic may be constrained to enable access to methods on data types. The information on the types that are used in a generics data type may be obtained at run-time by using reflection.

Prev Next
Answers (2)
PARTH Nov 25, 2020 07:56
Answer:   Generics enable the use of stronger type-checking, the elimination of casts, and the ability to develop generic algorithms.

RAMU Nov 25, 2020 08:10
Answer:   Generic types to maximize code re-usability, type safety, and performance. The main common use of generics is to create collection classes. The .NET Framework class library contains many new generic collection classes in the
System Collections. Generic namespace. These can be used whenever possible instead of classes such as Array List in the System. Collections namespace. We can create our own generic interfaces, classes, methods, events and delegates. Generic may be constrained to enable access to methods on data types. The information on the types that are used in a generics data type may be obtained at run-time by using reflection.

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect