1) One dimensional Array declaration with initialization (without array size)
Example:
int[] arr1 = { 12, 45, 56, 78, 89 };
In this style, arr1 will automatic occupy the size of the array based on given elements.
2) Dynamic One dimensional Array declaration with fixed size
Example:
int[] arr2 = new int[5];
In this style, arr2 will occupy the size for 5 integers dynamically.
3) Dynamic One dimensional Array declaration with variable size
Example:
int[] arr3 = new int[size];
Program:
Output