Generics ले तपाईंलाई classes र methods लिख्न दिन्छ जो type द्वारा parameterize गरिएको हुन्छ, type safety र reusability प्रदान गर्दै code duplication वा casting बिना। Constraints ले restrict गर्छ कि generic parameter कस्तो type हुन सक्छ, उनीहरूको members को safe उपयोग सक्षम गर्दै। Generics C# मा व्यापक छन् (सम्पूर्ण collections library उनीहरू प्रयोग गर्छ)।
The problem generics solve
=> arr[i];
=> arr[i];
x = Get([] { , , }, );
