Thursday, 5 September 2013

How to assign values to 2-D array?

How to assign values to 2-D array?

I have 2-D array:
String[][] letters = new String[5][5];
Also I have array with English alphabet.
String[] alphabet = new String[]{"a", "b", "c", ...};
How to fill 2-D array with letters from alphabet?
I excpect something like that:
{a, b, c, d, e},
{f, g, h, i, j},
{k, l, m, n, o},
{p, q, r, s, t},
{u, v, w, x, y};

No comments:

Post a Comment