摘要: 二维数组练习 package com.guoba.array; public class Demo05 { public static void main(String[] args) { /* 1,2 array[0] 00 01 2,3 array[1] 10 11 3,4 array[2] 2 阅读全文
posted @ 2021-12-13 20:12 锅巴编程 阅读(10) 评论(0) 推荐(0) 编辑
摘要: package com.guoba.array; public class Demo04 { public static void main(String[] args) { int[] arr = {1,2,3,4,5,6}; //JDK1.5,没有下标,增强for循环。 for (int i : 阅读全文
posted @ 2021-12-13 20:10 锅巴编程 阅读(87) 评论(0) 推荐(0) 编辑
摘要: package com.guoba.testhello; public class YunsuanfuDemo { public static void main(String[] args) { int a = 10; int b = 11; int c = 12; /** * 逻辑运算符 * & 阅读全文
posted @ 2021-12-13 20:08 锅巴编程 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 判断一个数是正数还是负数还是0、判断最大值 package com.guoba.testhello; import java.util.Scanner; public class ZuiDaZhi { public static void main(String[] args) { System.o 阅读全文
posted @ 2021-12-13 20:07 锅巴编程 阅读(421) 评论(0) 推荐(0) 编辑
摘要: package com.guoba.testhello; public class zhishu { public static void main(String[] args) { int[] arr1= new int[100]; int[] arr2= new int[100]; for (i 阅读全文
posted @ 2021-12-13 20:04 锅巴编程 阅读(22) 评论(0) 推荐(0) 编辑
摘要: package com.guoba.testhello; public class TiaojianDemo { public static void main(String[] args) { //使用一个条件运算符 //然后实现根据分数计算成绩分类的功能 //1.设置学生变量2.设置符合条件的区 阅读全文
posted @ 2021-12-13 19:48 锅巴编程 阅读(41) 评论(0) 推荐(0) 编辑
摘要: package com.guoba.testhello; /** * 转义字符 * \r 回车(CR) ,将当前位置移到本行开头 * \b 退格(BS) ,将当前位置移到前一列 * \f 换页(FF),将当前位置移到下页开头 * \n 换行(LF) ,将当前位置移到下一行开头 * \t 水平制表,( 阅读全文
posted @ 2021-12-13 19:45 锅巴编程 阅读(26) 评论(0) 推荐(0) 编辑
摘要: package com.guoba.math; public class MathTest { /* Math数学工具类,包含以下方法: .ceil() 向上取整 .floor() 向下取整 .round() 四舍五入 .max() 最大值 .min() 最小值 .abs() 绝对值 */ publ 阅读全文
posted @ 2021-12-13 19:43 锅巴编程 阅读(170) 评论(0) 推荐(0) 编辑
摘要: String与StringBuilder的互相转换 String转StringBulider StringBuilder sb = new StringBuilder(); sb.append(username); StringBulider转String StringBuilder sb = ne 阅读全文
posted @ 2021-12-13 19:39 锅巴编程 阅读(837) 评论(0) 推荐(0) 编辑
摘要: 计算所有元素的和 package com.guoba.array; public class Demo03 { public static void main(String[] args) { //定义数组 int[] arr = {1,2,3,4,5}; //打印数组全部元素 for (int i 阅读全文
posted @ 2021-12-13 19:19 锅巴编程 阅读(48) 评论(0) 推荐(0) 编辑