在java中使用二维数组保存颜色值
摘要:int colors[][] = { {0,0,0}, {127, 127, 127}, }; public void setColor() { for(int i=0;i<128;i++) { color = Color.rgb(colors[i][0],color[i][1],colors[i]
阅读全文
posted @
2025-10-29 12:11
小沙盒工作室
阅读(3)
推荐(0)
java数组语法
摘要://动态初始化 int[] array1 = new int[10];//前面的int[]为数组的类型,后面的int[10]为其能够存放的大小,array1为其数组名称 //静态初始化 int[] array2 = {1,2,3,4,5}; int[] array3 = new int[]{1,2,
阅读全文
posted @
2025-06-12 15:15
小沙盒工作室
阅读(2)
推荐(0)
java枚举
摘要:enum Mode{BAR,TIME}; Mode current_mode = Mode.TIME;
阅读全文
posted @
2025-06-07 18:32
小沙盒工作室
阅读(4)
推荐(0)
关于java手动抛出异常
摘要:你提出了一个非常经典且重要的 Java 异常处理问题 ✅: > **"为什么我手动写了 `throw new Exception("xxx")`,还要用 `try-catch` 捕获?"** ## ✅ 简短回答 ### ❓ 为什么抛出异常后还要 try-catch? 因为: - `throw` 是*
阅读全文
posted @
2025-06-04 19:33
小沙盒工作室
阅读(23)
推荐(0)