0
Please help decribe the below code where solve(grade) is int array
int[] result = solve(grades); for (int i = 0; i < result.length; i++) { Â Â Â Â Â Â System.out.print(result[i] + (i != result.length - 1 ? "\n" : "")); }
1 Answer
+ 4
If i is for the last array entry, concatenate a new line "\n" to the string. For every other array entry, concatenate a empty string.
(condition ? trueResult : falseResult) if the condition is true, this expression returns the trueResult value. Otherwise, the falseResult value is returned.