課程
/后端開發
/Java
/Java入門第一季(IDEA工具)升級版
2019-01-14
源自:Java入門第一季(IDEA工具)升級版 4-14
正在回答
你的case 1的輸出沒有換行。。。
public class HelloWorld {
? ? public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
switch ( i ) {
? ? case 1:
? ? ? ? System.out.println("*");
? ? continue;
case 2:
? ? ? ? System.out.println("**");
default:
? ? ? ? System.out.println("***");
}
舉報
0基礎萌新入門第一課,從Java環境搭建、工具使用、基礎語法開始
1 回答請問這樣為什么不行?
1 回答請問為什么這樣不行??
4 回答請問這么寫為什么不行呀
6 回答為什么這個不行??
2 回答這個為什么不行
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-01-14
你的case 1的輸出沒有換行。。。
public class HelloWorld {
? ? public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
switch ( i ) {
? ? case 1:
? ? ? ? System.out.println("*");
? ? continue;
case 2:
? ? ? ? System.out.println("**");
? ? continue;
default:
? ? ? ? System.out.println("***");
? ? continue;
}
}
}
}