vendingMachine[2][1]
vendingMachine.length
vendingMachine[0].length
//Consider the following code segment, and what it will print out as a result
int [][] numbers = {{1,2,3,4},{5,6,7,8}};
for(int[] nums: numbers)
for(int n: nums)
System.out.print(n + " ");
System.out.print("\n");
/*The following class, Arr2d, is meant to represent a 2 dimensional array object.
the constructor will initialize, Arr2d using the number of rows and columns that have been passed
Choose the statement that will initialize the array in the constructor*/
public class Arr2D{
private int [][] arr;
Arr2D( int rows, int columns)
{
/*missing code*/
}
}
//what should the missing code be?
/*a. int [] arr = new String [rows][columns];
b. int [][] arr = new String [rows-1][columns-1];
c.arr = new String [rows][columns];
d.arr = new String [rows-1][columns-1];
e.int arr [][] = new String [rows][columns];
*/
\