What are Generics in Dotnet Framework with c# example
Generics in Dotnet Framework
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
What are Generics in Dotnet Framework with c# example
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sangeetha SRank #212 · 11.4K reputationPosted May 21, 2025, 12:15 AM EDT
Generics in the .NET Framework are a powerful feature that allow you to define classes, interfaces, and methods with a placeholder for the data type. This enables type safety, code reusability, and performance improvements by avoiding boxing/unboxing and type casting.
Why Use Generics?
Built-in Generic Types
ListDictionaryQueue,StackNullable(for value types)Rajanikant HawaldarRank #110 · 20.2K reputationPosted May 21, 2025, 10:17 AM EDT
Refer below articles/blog
https://www.c-sharpcorner.com/UploadFile/84c85b/using-generics-with-C-Sharp/
https://www.c-sharpcorner.com/article/generics-in-C-Sharp3/