I tried so many different things, like replacing the all the public static chars with the '-'s; Ive tried the chars [1] = new char [] {'m', '-',.......} for both elements 1 &2; I cant figure out how to loop the new elements into it...i'm in a rough patch with this one.....
package en.codegym.task.jdk13.task06.task0633;
/*
Cutting down the middle
*/
public class Solution {
public static char[][] chars = {
{'a', 'b', 'c', 'd', 'e', 'f'},
{'j', 'h', 'i', 'j', 'k', 'l'},
{'m', 'n', 'o', 'p', 'q', 'r'},
{'s', 't', 'u', 'v', 'w', 'x'}};
public static void main(String[] args) {
printArray();
char [] tmp = chars[1];
chars [1] = new char[] {'j', '-', '-', '-', '-', 'l'};
char [] tmp2 = chars[2];
chars [2] = new char [] {'m', '-', '-', '-', '-', 'r'};//write your code here
printArray();
}
private static void printArray() {
for (int i = 0; i < chars.length; i++) {
for (int j = 0; j < chars[i].length; j++) {
System.out.print(chars[i][j] + " ");
}
System.out.println();
}
System.out.println();
}
}