COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
something[2][3] = 8.8;
|
|
something[2][4] = 8.8;
|
|
something[13.21] = 8.8;
|
|
something[3][4] = 8.8;
|
|
something[3][3] = 8.8;
|
Detailed explanation-1: -int baz [5] = ; This creates an array of five int values, each initialized with a value of zero: But, the elements in an array can be explicitly initialized to specific values when it is declared, by enclosing those initial values in braces .
Detailed explanation-2: -int[][] table = 1, 0, 1, 5, 3, 8 ; Which is the correct way to construct and assign a 2D array, with 8 rows, to popcorn, but does not have the rows constructed yet? int[][] popcorn = new int[8][]; We want to create a 2D double array with 6 rows and 7 columns and assign it to connectFour.
Detailed explanation-3: -Will this method correctly traverse an ArrayList and remove all multiples of 3? Yes, this method is written correctly, and will remove all multiples of 3 in an ArrayList.
Detailed explanation-4: -When would you use a for-each loop instead of a for loop? If you want to access every element of an array and want to refer to elements through a variable name instead of an array index.