I'am trying to copy or duplicate an Array without success
for (int i=0;i<x*y+y;i++)
{
tmpInt = br.read();
//Wenn i%x 0 ist dann brakeY eins hochzählen, um damit die Anzahl der Zeilen zu bekommen
if (i%x==0 && brakeY<y-1) brakeY++;
if (tmpX<=x-1) tmpX++;
else tmpX = 0;
// Beim ersten Ausführen dieser Teilfunktion wird das Array aus der Textdatei ausgelesen. Beim zweiten Mal jedoch gibt es nur den aktuellen Stand der Map wieder um Veränderungen zu sehen.
spielFeld[tmpX][brakeY] = (char) tmpInt;
System.out.print(spielFeld[tmpX][brakeY]);
//System.out.println("----------");
}
I'am trying to copy the Array, called spielFeld (german for playground), in this line spielFeldT = spielFeld.clone();
, (spielFeldT = spielFeld
didn't work either) so that I can interact with it globally. The results are:
1xwvutsrqpo
2 ü n
3 !öä m
4 " l
5 K §$% k
789abcdefgh
which is exactly how it's should look like, but if I'am tyring to print the copied array exactly the same way as I printed this one something like this appears.
1 ü �
3 !öä �n
4 " � l
5 K §$%� k
6 � fgh
789abcdefgh
789abcdefgh