I have 2 questions about the following code:
IEnumerable<int> arr = new int[] { 2, 17, 4, 6 };
Console.WriteLine(arr.GetType());
The output is:
System.Int32[]
- What is the class of "arr" variable? is it Array class? Does Array class equal every XXX[]?
- if arr is from Array class, how is it successfully converted to IEnumerable(int) interface? I see that Array implements only IEnumerable, but not IEnumerable(T)
Thanks