Answers the question below:
1. What do you call the 1st array/index in two dimensional array?
2. What do you call the 2nd array/index in two dimensional array?
3. What is the output of the given code?
double[] sales = {12.5, 32.50, 16.90, 23, 45.68,
9, 10.5};
for(int i=0; i<sales.length; i++)
{ } System.out.print(sales.length);
4. What is the output of the given code?
double[][] sales = {
{12.5, 32.50}, (16.90, 23, 45.68}, {1, 2, 3, 4},
};
System.out.print(sales[2][1]);
5. What is the output of the given code?
double[][] sales = {
(12.5, 32.50), (16.90, 23, 45.68}, {1, 2, 3, 4),
}; System.out.print(sales[1][1]);
Comments
Leave a comment