nerdexam
Oracle

1Z0-809 · Question #160

The following grid shows the state of a 2D array: O X O O O X X O X This grid is created with the following code: char[][] grid = new char[3][3]; grid[0][0] = 'O'; grid[0][1] = 'X'; grid[0][2] =…

The correct answer is C. grid [2] [0] = 'X'. You've hit your session limit · resets 10:20pm (America/New_York)

Question

The following grid shows the state of a 2D array: O X O O O X X O X This grid is created with the following code: char[][] grid = new char[3][3]; grid[0][0] = 'O'; grid[0][1] = 'X'; grid[0][2] = 'O'; grid[1][0] = 'O'; grid[1][1] = 'O'; grid[1][2] = 'X'; //line n1 grid[2][0] = 'X'; grid[2][1] = 'O'; grid[2][2] = 'X'; Which line of code, when inserted in place of //line n1. adds an x into the grid so that the grid contains three consecutive X'S?

Options

  • Agrid [1] [3] = 'X';
  • Bgrid [1] [2] = 'X';
  • Cgrid [2] [0] = 'X';
  • Dgrid [0] [2] = 'X';
  • Egrid [3] [1] = 'X';

How the community answered

(39 responses)
  • A
    5% (2)
  • B
    13% (5)
  • C
    77% (30)
  • D
    3% (1)
  • E
    3% (1)

Explanation

You've hit your session limit · resets 10:20pm (America/New_York)

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice