What are the different ways to create an array in C#?

In C#, there are several ways to create an array:

  1. Initializing with arrays:
int[] numbers = {1, 2, 3, 4, 5};
  1. recent
int[] numbers = new int[5];
  1. Create an array instance
Array numbers = Array.CreateInstance(typeof(int), 5);
  1. Creating an array using the CreateInstance method.
int[] numbers = (int[])Array.CreateInstance(typeof(int), 5);
bannerAds