2024年4月21日

摘要: public class Demo05 { public static void main(String[] args) { int[][]array={{1,2},{2,3},{3,4},{4,5}}; printArray(array[0]); System.out.println(" "); 阅读全文
posted @ 2024-04-21 14:18 anonymity。 阅读(3) 评论(0) 推荐(0) 编辑
 
摘要: public class Demo4 { public static void main(String[] args) { int [] arrays= {1,2,3,4,5}; //printArrary(arrays); //JDK1.5,没有下标 //for (int array:arrays 阅读全文
posted @ 2024-04-21 11:09 anonymity。 阅读(2) 评论(0) 推荐(0) 编辑

2024年4月20日

摘要: public static void main(String[] args) { int [] arrays= {1,2,3,4,5}; printArrary(arrays); } //打印数组元素 public static void printArrary(int[] arrays){ for 阅读全文
posted @ 2024-04-20 18:08 anonymity。 阅读(3) 评论(0) 推荐(0) 编辑
 
摘要: public class Dmo03 { public static void main(String[] args) { int [] arrays={1,2,3,4,5}; //打印全部的数组元素 for (int i=0;i< arrays.length;i++){ System.out.pr 阅读全文
posted @ 2024-04-20 15:32 anonymity。 阅读(2) 评论(0) 推荐(0) 编辑
 
摘要: public class Demo01 { public static void main(String[] args) { int [] nums;//1.声明一个数组 nums =new int[10];//2.创建一个数组 //声明并创建一个数组 int [] nums2 =new int[1 阅读全文
posted @ 2024-04-20 10:32 anonymity。 阅读(2) 评论(0) 推荐(0) 编辑

2024年4月19日

摘要: public static void main(String[] args) { System.out.println("欢迎来到简易计算器!"); Scanner scanner =new Scanner(System.in); System.out.println("请输入要计算的第一个数字:" 阅读全文
posted @ 2024-04-19 13:10 anonymity。 阅读(6) 评论(0) 推荐(0) 编辑

2024年4月18日

摘要: public static void main(String[] args) { System.out.println(f(5)); } public static int f(int n){ if (n==1){ return 1; }else { return n*f(n-1); } } 阅读全文
posted @ 2024-04-18 18:18 anonymity。 阅读(3) 评论(0) 推荐(0) 编辑
 
摘要: public class Demo04 { public static void main(String[] args) { Demo04 demo04 =new Demo04(); demo04.test(1,2,3,4,5); } public void test (int ...i){ Sys 阅读全文
posted @ 2024-04-18 17:50 anonymity。 阅读(2) 评论(0) 推荐(0) 编辑
 
摘要: public class Demo02 { public static void main(String[] args) { double larger =max(10.0,20.0); System.out.println(larger); } public static double max ( 阅读全文
posted @ 2024-04-18 17:03 anonymity。 阅读(3) 评论(0) 推荐(0) 编辑

2024年3月8日

摘要: Markdown学习 #+空格+回车 二级标题 ##+空格+回车 三级标题 # # #+空格+回车 四级标题 ####+空格+回车 hello,world! 前后各两个*号+回车 hello,world! 前后各一个*号+回车 hello,world! 三个*号+回车 hello,world! 前后 阅读全文
posted @ 2024-03-08 17:48 anonymity。 阅读(2) 评论(0) 推荐(0) 编辑