摘要: package array; public class demo02 { public static void main(String[] args) { //三种数组的初始化方法 //1.静态初始化 int[] a1= {1,2,3,4,5,6}; for (int i = 0; i < 6; i 阅读全文
posted @ 2022-05-11 18:59 回忆也交给时间 阅读(122) 评论(0) 推荐(0)
摘要: package array; public class demo01 { public static void main(String[] args) { int[] nums;//声明一个数组 nums = new int[10];//创建数组开始有空间 //赋值数组 nums[0]=1; num 阅读全文
posted @ 2022-05-10 23:14 回忆也交给时间 阅读(13) 评论(0) 推荐(0)
摘要: package www.nihao; import java.util.Scanner; public class counter { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); S 阅读全文
posted @ 2022-05-10 18:49 回忆也交给时间 阅读(27) 评论(0) 推荐(0)
摘要: package www.nihao; public class demo06 { public static void main(String[] args) { System.out.println(f(5)); } public static int f(int i){ if(i==1) ret 阅读全文
posted @ 2022-05-10 10:03 回忆也交给时间 阅读(22) 评论(0) 推荐(0)
摘要: package www.nihao;public class demo05 { public static void main(String[] args) {printmax(1,2,3,4,5,6,7,8,6,9);printmax(new double[]{1,2,3}); } public 阅读全文
posted @ 2022-05-09 19:24 回忆也交给时间 阅读(15) 评论(0) 推荐(0)
摘要: javac :编译命令 java :执行命令 阅读全文
posted @ 2022-05-09 19:04 回忆也交给时间 阅读(33) 评论(0) 推荐(0)
摘要: package www.nihao; public class demo03 { public static void main(String[] args) { double max=max(10.0,100.0); System.out.println(max); } //求最大数的方法 pub 阅读全文
posted @ 2022-05-09 18:40 回忆也交给时间 阅读(24) 评论(0) 推荐(0)
摘要: package www.nihao; public class demo03 { public static void main(String[] args) { int max=max(10,10); System.out.println(max); } //求最大数的方法 public stat 阅读全文
posted @ 2022-04-27 18:31 回忆也交给时间 阅读(33) 评论(0) 推荐(0)
摘要: package www.nihao; import java.util.Scanner; public class demo02 { public static void main(String[] args) { //main方法 Scanner scanner = new Scanner(Sys 阅读全文
posted @ 2022-04-26 23:36 回忆也交给时间 阅读(56) 评论(0) 推荐(0)
摘要: package www.nihao; public class demo01 { public static void main(String[] args) { //打印三角形 5行 for(int i=1; i<=5;i++) { for (int j=5;j>=i;j--){ System.o 阅读全文
posted @ 2022-04-26 23:00 回忆也交给时间 阅读(29) 评论(0) 推荐(0)