9.10 Exercises, Problems, and Projects
9.10.1 Multiple Choice Exercises
-
1. What is/are the valid way(s) to declare a two-dimensional integer array named a? (Check all that apply.)
❑ int [ ][ ] a;
❑ int a [ ][ ];
❑ array [ ] int a;
❑ int array [ ] a;
-
2. A two-dimensional array is an array of arrays.
❑ true
❑ false
-
3. In a two-dimensional array, every row must have the same number of columns.
❑ true
❑ false
-
4. What is the default value of the elements of a two-dimensional array of booleans after declaration and instantiation of the array?
❑ true
❑ false
❑ undefined
-
5. How do you access the element of array a located at row 2 and column 4?
❑ a{2}{4}
❑ a( 2,4 )
❑ a[2][4]
❑ a[4][2]
-
6. How do you retrieve ...
Get Java Illuminated, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.