## Encrypted Junior Poster in Training

I'm trying to convert a row from a matrix of Char's to a String and all I've been able to get is a bunch of memory locations. I was hoping someone can lend me a hand. Here's what I've got:

``````for(int c=0; c<tempBoard.length; c++){
String charArray = " ";
for(int v=0; v<tempBoard.length; v++){
board[c][v] = tempBoard[c][v];
charArray = tempBoard[c].toString();
}
System.out.println(charArray);
}``````

## BestJewSinceJC 700

Calling a String 'charArray' is pretty confusing to say the least. Anyway, here is an example to clear things up. This puts the first rows of chars into the variable temp.

``````char[][] chars = new char;

//Put some stuff in the 2d array
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
chars[i][j] = (char) (i*j);

// 0 is the row, i is the column
String temp = "";
for (int i = 0; i < 10; i++) temp+=chars[i];``````

## Encrypted

Thanks, that should do it.. not sure why I didn't think of that. About the variable.. yeh I know, I'm too used to coding in C and that happened to be the first thing that crossed my mind.

Calling a String 'charArray' is pretty confusing to say the least. Anyway, here is an example to clear things up. This puts the first rows of chars into the variable temp.

``````char[][] chars = new char;

//Put some stuff in the 2d array
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
chars[i][j] = (char) (i*j);

// 0 is the row, i is the column
String temp = "";
for (int i = 0; i < 10; i++) temp+=chars[i];``````