Interviews2 answers
Can you store different types in an Array in C# ?
2 Answers
ya
by the use of object array
like
object[] a=new object[10];
Mukesh KumarPosted Aug 28, 2017, 5:17 AM EDT
The answer is yes! if we create object array. all types in .net inherits directly or indirectly from system.object. we can add any types of object array including complex types like employee class ,student class.
Second option is to use ArrayList class which is present in system.collection .namespace.
Kshitiz BhargavPosted Aug 21, 2016, 9:35 PM EDT

