290114lyp

导航

2022年11月9日

方法的定义和调动

摘要: 修饰符 返回值类型 方法名(参数类型 参数名){ ... 方法体 ... return 返回值; } package com.jiemo.method;public class Shabi1 { //main public static void main(String[] args) { //实际 阅读全文

posted @ 2022-11-09 15:09 是芥末!日 阅读(14) 评论(0) 推荐(0) 编辑

什么是方法

摘要: package com.jiemo.method;public class Shabi1 { //main public static void main(String[] args) { // int sum= add(1,2); // System.out.println(sum); test( 阅读全文

posted @ 2022-11-09 14:32 是芥末!日 阅读(13) 评论(0) 推荐(0) 编辑

break&continue

摘要: package com.jiemo.struct;public class BreakShabi { public static void main(String[] args) { int i=0; while (i<100){ i++; System.out.println(i); if (i= 阅读全文

posted @ 2022-11-09 13:51 是芥末!日 阅读(9) 评论(0) 推荐(0) 编辑

2022年10月27日

增强for循环

摘要: 增强for循环 for(声明语句:表达式) { //代码句子 } package com.jiemo.struct;public class ForShabi5 { public static void main(String[] args) { int[] numbers={10,20,30,40 阅读全文

posted @ 2022-10-27 13:51 是芥末!日 阅读(9) 评论(0) 推荐(0) 编辑

用for打印九九乘法表

摘要: package com.jiemo.struct;public class ForShabi4 { public static void main(String[] args) { //1.先打印第一列 //2.把固定的i再用一个循环包起来 //3.去掉重复项,i<=j //4.调整样式 for ( 阅读全文

posted @ 2022-10-27 13:38 是芥末!日 阅读(11) 评论(0) 推荐(0) 编辑

For 循环

摘要: For 循环 for(初始化;布尔表达式;更新){ //代码语句 } package com.jiemo.struct;public class ForShabi1 { public static void main(String[] args) { int a = 1;//初始化条件 while 阅读全文

posted @ 2022-10-27 13:15 是芥末!日 阅读(51) 评论(0) 推荐(0) 编辑

2022年10月26日

Do whlie 循环

摘要: Do whlie 循环 ◆对于while语句而言,如果不满足条件,则不能进入循环。但有时候我们需要即使不满足条件,也至少执行-次。 ◆do...while循环和while循环相似,不同的是,do...while 循环至少会执行一次。 do { //代码语句 }while(布尔表达式); ◆While 阅读全文

posted @ 2022-10-26 19:44 是芥末!日 阅读(21) 评论(0) 推荐(0) 编辑

While循环

摘要: While循环 while(布尔表达式) { //循环内容 ◆只要布尔表达式为true,循环就会一直执行下去。 ◆我们大多数情况是会让循环停止下来的,我们需要一个让表达式失效的方式来结束循环。 ◆少部分情况需要循环一直执行,比如服务器的请求响应监听等。 ◆循环条件一直为true就会造成无限循环[死循 阅读全文

posted @ 2022-10-26 19:26 是芥末!日 阅读(11) 评论(0) 推荐(0) 编辑

switch多选择结构

摘要: package com.jiemo.struct;public class SwitchShabi1 { public static void main(String[] args) { //case 穿透 //switc 匹配一个具体的值 char grade ='A'; switch (grad 阅读全文

posted @ 2022-10-26 19:04 是芥末!日 阅读(16) 评论(0) 推荐(0) 编辑

2022年10月23日

结构选择

摘要: if单选择结构 if(布尔表达式){ //如果布尔表达式为true将执行的语句 } package com.jiemo.struct;import java.util.Scanner;public class Ifshabi1 { public static void main(String[] a 阅读全文

posted @ 2022-10-23 21:27 是芥末!日 阅读(14) 评论(0) 推荐(0) 编辑