摘要: 二维数组 public static void main(String[] args) { //二维数组 /* * 1,2 array[0] * 2,3 array[1] * 3,4 array[2] * 4,5 array[3] * */ int[][] array={{1,2},{2,3},{3 阅读全文
posted @ 2024-01-04 17:46 fightownself 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 反转数组 public static void main(String[] args) { int[] arrays = {1,2,3,4,5}; int[] reverse = reverse(arrays); printArray(reverse); } //反转数组 public static 阅读全文
posted @ 2024-01-04 17:24 fightownself 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 数组的定义 变量的类型 变量的名字 = 变量的值 数组的类型 public static void main(String[] args) { // 变量的类型 变量的名字 = 变量的值 //数组的类型 int[] nums;//1.声明一个数组 nums = new int[10];//2.创建一 阅读全文
posted @ 2024-01-04 16:08 fightownself 阅读(4) 评论(0) 推荐(0) 编辑
摘要: for 循环的案例分析 //计算0到100以内基数和偶数的和 public static void main(String[] args) { //计算0到100以内基数和偶数的和 int oddSum = 0; int evenSum = 0; for (int i = 0; i<= 100; i 阅读全文
posted @ 2023-12-26 18:04 fightownself 阅读(5) 评论(0) 推荐(0) 编辑
摘要: do....while 与while 的区别 while 先判断后执行,do while是先执行后判断 do while 总是保证循环体会被至少执行一次 public static void main(String[] args) { int a =0; while (a <0){ System.o 阅读全文
posted @ 2023-12-26 17:44 fightownself 阅读(4) 评论(0) 推荐(0) 编辑
摘要: if的多循环结构 public static void main(String[] args) { Scanner scanner = new Scanner(System.in);//创建一个扫描器对象,用于接受键盘数据 System.out.println("请输入成绩:"); int scor 阅读全文
posted @ 2023-12-22 11:39 fightownself 阅读(15) 评论(0) 推荐(0) 编辑
摘要: scanner的用法 定义一个scanner Scanner scanner =new Scanner(system.in) 字符串用法 public class Demo01 { public static void main(String[] args) { Scanner scanner = 阅读全文
posted @ 2023-12-22 09:52 fightownself 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 数据类型 强类型语言 要求变量的使用要严格符合规范,所有变量都必须先定义后再使用 基本类型-八大数据类型 //八大数据类型 //整数 int num1 = 10; byte num2 = 20; short num3 = 30; long num4 = 40L;//long类型要在数字后面加个L;​ 阅读全文
posted @ 2023-12-15 16:09 fightownself 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 打印9*9乘法表 1.先打印第一列 for (int i = 1; i <= 9; i++) { System.out.println(1+"*"+i+"="+(1*i)); } 2.把固定的1再用一个循环包起来 for (int j = 1; j <=9; j++) { for (int i = 阅读全文
posted @ 2023-11-17 16:23 fightownself 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #盘符切换cd /d d:\user\文件#查看当前目录下的所有文件dir#清理屏幕cls (clear screen)#退出终端exit#查看IPipconfig#打开应用calcmspaintnotepad#pingping www.baidu.com#文件命令rd 目录名 删除目录md 目录名 阅读全文
posted @ 2023-03-02 16:07 fightownself 阅读(8) 评论(0) 推荐(0) 编辑