Can you store different types in an array in c#?



Can you store different types in an array in c#?..

Answer / Manish Panchal

No, in C# arrays are strongly typed and must contain elements of the same data type. Use List<T> instead for a more flexible collection of objects.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Can an exception be thrown from a catch block?

1 Answers   Alcatel-Lucent,


What is datagridview in c#?

1 Answers  


Can we have private constructor in our class file. When we are trying to create instance for the class will it create or throw error regarding that?

5 Answers  


You have got 1 million parking slots. At a time a parking slot can be free or not. To get next slot easily which data structure to implement?

1 Answers  


Is XML case-sensitive?

3 Answers   Wipro,


How do I link two windows forms in c#?

1 Answers  


What is the data encapsulation?

1 Answers  


What are the types of constructors?

1 Answers  


who is a protected class-level variable available to?

1 Answers   Siebel Systems,


What kind of the information stored inside the assembly?

1 Answers   CitiusTech,


Can we have multiple constructors in a class c#?

1 Answers  


What are the different types of assemblies available and their purpose?

1 Answers  


Categories