Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 419 Bytes

File metadata and controls

16 lines (12 loc) · 419 Bytes

Array Initializers

To give an initial value to a multi-dimensional array you can use multiple nested array initializers.

These are the same as normal array initializers but with potentially more initializers inside.1

String[][] ticTacToe = {
    { "O", "",  "O" },
    { "X", "O", "X" },
    { "O", "X", "X" }
}

Footnotes

  1. When array initizalize and more initialize inside that's a moray.