1.

What are the Arrays in C#?

Answer»

When a GROUP of similar elements is clubbed together under one name, they are called arrays. 

For ex. An array of tea Atea[4]: [green tea, chamomile tea, BLACK tea, lemon tea]. The length of the array defines how many elements are present in the array. 

In C#, the memory allocations for the elements of the array happen dynamically.  This is how values are stored in an array sequentially.

Arrays in C#

A few pointers for arrays in C#:

  • The memory ALLOCATION is DYNAMIC.
  • Arrays in C# are treated as objects.
  • The length of the array is easy to find by DETECTING the number of members in the array.
  • The members in the array are ordered and begin with the INDEX value=0.
  • The array types are reference types derived from the base array type.

Syntax: < Data Type > [ ] < Name_Array >



Discussion

No Comment Found