+ 2
Generic Classes
I've tried to understand generic classes but i couldn't understand it perfectly..who can help me
1 Odpowiedź
+ 1
A generic class is just a class that can hold any type of data.
The best generic class is list
List<string> stringlist = new List<string>();
List<int> stringlist = new List<int>();
List<MyClass> stringlist = new List<MyClass>();
Generic is not free. You need to tell the compiler which type you are using. But with list you are able to use the same type for lots of different data types.