exam questions

Exam 98-388 All Questions

View all questions & answers for the 98-388 exam

Exam 98-388 topic 1 question 13 discussion

Actual exam question from Microsoft's 98-388
Question #: 13
Topic #: 1
[All 98-388 Questions]

HOTSPOT -
You are writing a Java method.
The method accepts a two-dimensional String array and prints the content of each array element.
The size of each dimension of the array might be different.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
References:
https://www.tutorialgateway.org/two-dimensional-array-in-java/

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
prasadkadu
4 years, 9 months ago
the 3rd answer will be board.length
upvoted 2 times
DField
4 years, 8 months ago
It says that the size of each dimension of the array might be different, so the answer (board[x].length) is correct. For non-square arrays, using board.length there would either lead to elements being skipped or an ArrayIndexOutOfBoundsException being thrown, depending on which dimension is larger.
upvoted 6 times
Abhitera
4 years, 4 months ago
Correct
upvoted 1 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...