Which Is The Correct Way Of Defining And Initializing An Array #225
Which is the correct way of defining and initializing an array of 3 integers?
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Arrays and Strings - Array and Initialization - Quiz No.1.
Which is the correct way of defining and initializing an array of 3 integers?
int[] a={78, 54};
int[] a; a = new int[3]; a[1] = 78; a[2] = 9; a[3] = 54;
int[] a; a = new int{78, 9, 54};
int[] a; a = new int[3]{78, 9, 54};