摘要: 整数类型 浮点数型 字符类型 boolean类型 byte,short,int,long float,double char long数字要加L floa数字要加F true与false String属于字符类型 byte>short>int>long>float>double char和Strin 阅读全文
posted @ 2026-06-15 20:16 墨洛温酒 阅读(2) 评论(0) 推荐(0)
摘要: package Demo05; import java.util.Arrays; public class ArrayDemo05 { public static void main(String[] args) { int[] a = {1, 2, 3, 44, 55, 777, 666}; // 阅读全文
posted @ 2026-06-15 09:55 墨洛温酒 阅读(2) 评论(0) 推荐(0)
摘要: ackage Demo05; public class Demo04 { public static void main(String[] args) { //[4][2] /* 1,2 array[0] 2,3 array[1] 3,4 array[2] 4,5 array[3] */ int[] 阅读全文
posted @ 2026-06-15 09:51 墨洛温酒 阅读(1) 评论(0) 推荐(0)
摘要: package Demo05; public class Demo03 { public static void main(String[] args) { int[] arrays = {1, 2, 3, 4, 5}; //jDk1.5 没有下标 //for (int array : arrays 阅读全文
posted @ 2026-06-15 09:49 墨洛温酒 阅读(2) 评论(0) 推荐(0)
摘要: package Demo05; import java.lang.management.ManagementFactory; public class Demo01 { public static void main(String[] args) { //静态初始化 int[] a = {1,2,3 阅读全文
posted @ 2026-06-15 09:45 墨洛温酒 阅读(2) 评论(0) 推荐(0)
摘要: package Demo04; public class Dmo9 { //数组类型 //变量的类型 变量的名字 = 变量的值 public static void main(String[] args) { int[] nums;//1.声明一个数组 //1.定义 常用 //这里面可以存放10个i 阅读全文
posted @ 2026-06-15 09:26 墨洛温酒 阅读(2) 评论(0) 推荐(0)
摘要: package Demo04; public class Demdohd01 { //maina方法 public static void main(String[] args) { //实际参数:实际传递给他的参数 int sum = add(1, 2); System.out.println(s 阅读全文
posted @ 2026-06-15 09:22 墨洛温酒 阅读(3) 评论(0) 推荐(0)
摘要: package Demo03; public class forDemo06 { public static void main(String[] args) { int[] numbers = {10,20,30,40,50};//定义了一个数组 //遍历数组的元素 for (int x:numb 阅读全文
posted @ 2026-06-14 16:29 墨洛温酒 阅读(2) 评论(0) 推荐(0)
摘要: ublic class forDemo01 { public static void main(String[] args) { int a = 1;//初始化条件 while (a <= 100) {//条件判断 System.out.println(a);//循环体 a += 2;//迭代 } 阅读全文
posted @ 2026-06-14 15:55 墨洛温酒 阅读(2) 评论(0) 推荐(0)
摘要: package Demo03; public class BreakDemo01 { public static void main(String[] args) { int i = 0; while (i<100) { i++; System.out.println(i); if (i == 30 阅读全文
posted @ 2026-06-14 15:51 墨洛温酒 阅读(2) 评论(0) 推荐(0)