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();
//write your code here
chars[1] = new char[] {'j', '-', '-', '-', '-', 'l'};
chars[2] = new char[] {'m', '-', '-', '-', '-', 'r'};
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();
}
}
Hi. Why doesn't my code work ?
Under discussion
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Leo O
4 May 2022, 11:11
You wrote two times the character j. One is instead of g!
-1
wilbert stewart
2 May 2022, 22:01
I Got a notification that my credit score has dropped so when I checked it ,it went from a 760 down to 617 .I was totally stunned . Nothing has changed that i'm aware of ,all my bills are paid on time and not much card debt .I was so surprised how it is possible to drop so much and have no idea why .I saw an article that says thirty days late payments will stay on your reports for two years. I now remembered I had one late payment about four years ago. It was a sad experience for me and my lovely wife .we needed an immediate solution , that was when we came across some local community beneficiaries reviews of NEWHORIZONCREDIT1 ,then i contacted them at ( NEWHORIZONCREDIT1ATGMAILdotCOM ) .I was so shocked when i received an email regarding changes on my credit report .I discovered all my negative tradelines were off and my credit score increased from 617 -785 within five working days .
0
Lisa L
1 May 2022, 14:36
Maybe validation checks the 'original' arrays but you assigned new nested arrays.
But that's just a guess ;)
+2
Miles118
1 May 2022, 17:03
Alright thanks. I will use the loop like they want me to then.
0