Question
Different between Curly braces{} and brackets[] while initializing array in C#?
I am really curious to know what is the different between these lines?
//with curly braces
int[] array2 = { 1, 2, 3, 4, };
//with brackets
int[] array3 = [1, 2, 3, 4,];
Console.WriteLine(array2[1]);
Console.WriteLine(array3[1]);
//the output is the same.
I want to know what is the different between using curly braces and brackets while initializing values.
8 797
8