Multiple choice .net

Which method will return the number of elements in an array?

  1. Dimension

  2. Length

  3. Number

  4. Size

  5. UpperBound

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The Length property returns the total number of elements in all dimensions of an array. For example, if an array has 10 elements, array.Length returns 10. UpperBound returns the highest index, not the count.