与えられる: パブリック クラス ColorTest { public static void main(String[] args) { String[] 色 = {"赤"、"青"、"緑"、"黄"、"栗色"、"シアン"}; int count = 0; for (String c : colors) { if (count >= 4) { break; } else { continue; } if (c.length() >= 4) { colors[count] = c.substring(0,3); } count++; } System.out.println(colors[count]); } } 結果は何ですか?
正解:C
The line, if (c.length() >= 4) {, is never reached. This causes a compilation error. Note: The continue statement skips the current iteration of a for, while , or do-while loop. An unlabeled break statement terminates the innermost switch, for, while, or do- while statement, but a labeled break terminates an outer statement.