I was wondering while researching arrays in the C# Microsoft reference if there’s any difference (and there must be, its computer science after all) between declaring the array in Ben’s way and declaring it this way;
Ben’s way:
String[] level1Passwords = { "book", "pencil", "pen" };
other way:
int[] scores = new int[] { 97, 92, 81, 60 };
What is the use of this “new int []” before listing the array’s objects?
Wasn’t it enough to write down the “int[]” before the name of the array?
Thank you for your time and convenience~
Reference:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/