/*
Resuability/Parameterize -- Ability to parameterize value for the data type
int Add(int x, int y) -- Why only int ? Why something not generic ?
{
return x+y;
}
**Scala : allows one to develop a language itself ! -- DO THIS !!!
T Add<T>(T x, T y) -- Here T can take any type -- hence parameteric polymorphism //In DotNet it is referred to as -- GENERIC METHODS/ GENERIC CLASS
Add<int>(10, 20);
Add<string>("asd", "ada");
Add<float>(3.14, 5.87);
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
class DA
int x;
class DA<T> // GENERIC CLASS
T x;
DA<int> _obj = new DA<int>();
DA<string> _obj = new DA<string>();
class DynamicArray
object[] buffer;
class DynamicArray<T>
T[] buffer;
DynamicArray<int>_obj1 = new DynamicArray<int>();
DynamicArray<string>_obj2 = new DynamicArray<atring>();
COLLECTIONS
Rule - how to Add, Remove, Address
1. Indexed Based Collections - List
2. KeyBased Collection - HashTable, Dictionary
3. Order Based Collection - Stack, Queue, LinkedList
*These all are dynamic in nature and all have generic versions too.
*/
using System;
public class Program
public static void Main()