2021年4月19日

摘要: 数组声明和赋值 package com.kuang.array; public class ArrayDemo01 { //变量的类型 变量的名字 = 变量的值 //数组类型 public static void main(String[] args) { //首选 int[] nums;//1.声 阅读全文
posted @ 2021-04-19 20:32 努力奋斗加油 阅读(53) 评论(0) 推荐(0) 编辑

2021年4月15日

摘要: package com.kuang.scanner; import java.util.Scanner; public class Demo06 { public static void main(String[] args) { jisuanqi(); } public static void j 阅读全文
posted @ 2021-04-15 20:35 努力奋斗加油 阅读(168) 评论(0) 推荐(1) 编辑

2021年4月14日

摘要: 何为方法: package com.kuang.method; public class Demo01 { //main方法 public static void main(String[] args) { int sum = add(1,2); System.out.println(sum); } 阅读全文
posted @ 2021-04-14 19:39 努力奋斗加油 阅读(53) 评论(0) 推荐(0) 编辑

2021年4月13日

摘要: package com.kuang.struct; public class TestDemo { public static void main(String[] args) { //打印三角形 5行 for (int i = 1; i <= 5; i++) { for (int j = 5; j 阅读全文
posted @ 2021-04-13 20:37 努力奋斗加油 阅读(17) 评论(0) 推荐(0) 编辑
摘要: package com.kuang.struct; public class ForDemo03 { public static void main(String[] args) { //练习2:用while或for循环输出1-1000之间能被5整除的数,并且每行输出3个 // for (int i 阅读全文
posted @ 2021-04-13 20:26 努力奋斗加油 阅读(38) 评论(0) 推荐(0) 编辑

2021年4月8日

摘要: package com.kuang.struct; public class DoWhileDemo01 { public static void main(String[] args) { int i = 0; int sum = 0; do { sum = sum+i; i++; }while( 阅读全文
posted @ 2021-04-08 20:16 努力奋斗加油 阅读(30) 评论(0) 推荐(0) 编辑
摘要: package com.kuang.struct; public class WhileDemo01 { public static void main(String[] args) { //输出1-100 int i = 0; while (i<100) { i++; System.out.pri 阅读全文
posted @ 2021-04-08 20:10 努力奋斗加油 阅读(45) 评论(0) 推荐(0) 编辑
摘要: switch变量可以是:int short char byte String package com.kuang.struct; public class SwitchDemo01 { public static void main(String[] args) { //case穿透 //switc 阅读全文
posted @ 2021-04-08 19:50 努力奋斗加油 阅读(45) 评论(0) 推荐(0) 编辑
摘要: if单选结构: package com.kuang.struct; import java.util.Scanner; public class IfDemo01 { public static void main(String[] args) { Scanner scanner = new Sca 阅读全文
posted @ 2021-04-08 19:37 努力奋斗加油 阅读(40) 评论(0) 推荐(0) 编辑
摘要: package com.kuang.struct; public class ShunXuDemo { public static void main(String[] args) { System.out.println("Hello 1"); System.out.println("Hello 阅读全文
posted @ 2021-04-08 19:12 努力奋斗加油 阅读(21) 评论(0) 推荐(0) 编辑