exam questions

Exam 1z0-808 All Questions

View all questions & answers for the 1z0-808 exam

Exam 1z0-808 topic 1 question 135 discussion

Actual exam question from Oracle's 1z0-808
Question #: 135
Topic #: 1
[All 1z0-808 Questions]

This grid shows the state of a 2D array:

The grid is created with this code:

Which line of code, when inserted in place of //line n1, adds an X into the grid so that the grid contains three consecutive XS?

  • A. grid[2][1] = 'X';
  • B. grid[3][2] = 'X';
  • C. grid[3][1] = 'X';
  • D. grid[2][3] = 'X';
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
MPignaProTech
2 months, 3 weeks ago
Selected Answer: A
Index [3] is bad so good answer is A
upvoted 1 times
...
dsms
1 year, 5 months ago
Selected Answer: A
The correct answer is A. grid[2][1] = 'X';
upvoted 1 times
...
dsms
1 year, 5 months ago
Selected Answer: D
The correct answer is D: grid[2][1] = 'X';
upvoted 1 times
dsms
1 year, 5 months ago
oh sorry, misprinting: The correct answer is A. grid[2][1] = 'X';
upvoted 2 times
...
...
akbiyik
2 years, 1 month ago
Selected Answer: A
The correct answer is A
upvoted 1 times
...
iSnover
2 years, 3 months ago
Selected Answer: A
The correct answer is A. The answer D will return an exception because there is no way to access the 3rd place. Always remember that Java indexes from 0, to make a complete line of X we need to put an X in the second place from the third line and I say again, as java indexes from 0, so it is grid[2][1] = 'X';
upvoted 2 times
...
shivkumarx
2 years, 4 months ago
The answer can't be D as 3 goes out of bounds of array, answer is A
upvoted 3 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago