Interview Question
Qus: What is the Generic and non generic collections?
Two types of collections is there one is generic collection another one is non generic collection.
Generic Collection:
We can group one type of object in single collection is called generic collection. Here we dont need to convert particular type like string, int, etc.
Non Generic Collection:
We can group any type of object in single collection is called non generic collection. Here we need to convert particular type like string, int,etc., otherwise we will face issue in run time.
Answers (2)
Generic Collection:
We can group one type of object in single collection is called generic collection. Here we dont need to convert particular type like string, int, etc.
Non Generic Collection:
We can group any type of object in single collection is called non generic collection. Here we need to convert particular type like string, int,etc., otherwise we will face issue in run time.
For example ? List, Dictionary, Hashset
Non-Generics Collections - Non-generic collections hold elements of different datatypes.
For example - ArrayList, BitArray.