Which of the following are valid lines of code to define a multidimensional int array?
array()
{{1, 2, 3}, {}, {1, 2,3, 4, 5}};a, d
Option (b) is incorrect.
This line of code won't compile because new array()
isn't valid code.
Unlike objects of other classes, an array isn't initialized using the keyword new followed by the word array.
When the keyword new is used to initialize an array, it's followed by the type of the array, not the word array.
Option (c) is incorrect.
To initialize a two-dimensional array, all of these values must be enclosed within another pair of curly braces, as shown in the code in option (a).