摘要:
break跳出循环 public class tiaochu{ public static void main(String args[]){ for(int a=1;a<10;a++){System.out.print("tiaocchu");if(a==3){break;}} } } conti
阅读全文
posted @ 2021-03-31 16:55
zfj822
阅读(55)
推荐(0)
编辑
摘要:
while 循环 while是最基本的循环,它的结构为: while( 布尔表达式 ) { //循环内容 } package xunhuan;public class wxh { public static void main(String args[]) { int a=1; while(a<10
阅读全文
posted @ 2021-03-31 14:02
zfj822
阅读(61)
推荐(0)
编辑
摘要:
for循环结构: 1.for(初始化; 布尔表达式; 更新) { //代码语句 }: public class Test { public static void main(String args[]) { for(int x = 10; x < 20; x = x+1) { System.out.
阅读全文
posted @ 2021-03-31 11:12
zfj822
阅读(192)
推荐(0)
编辑
摘要:
if语句 public class ifyj{ public static void main(Spring[] args){ int a = 5; int b=10; if(a>b){System.out.print("判断语句");} else if(a==b) {System.out.prin
阅读全文
posted @ 2021-03-31 09:01
zfj822
阅读(47)
推荐(0)
编辑