摘要: ​1、控制台输入月份,输出该月为第几季度? int month = 12; int quarter = (month-1)/3+1; System.out.println(quarter); 2、控制台输入年、月、日,输出该日期为星期几? public static void main(String 阅读全文
posted @ 2022-03-13 13:42 北极光zzZ 阅读(36) 评论(0) 推荐(0)
摘要: ​[COT] 1、冒泡排序 import java.util.Random; public class ownTest { //将数组 array 中 begin 和 end 两个位置的值交换 public void swap(int[] array,int begin,int end){ int 阅读全文
posted @ 2022-03-13 13:39 北极光zzZ 阅读(36) 评论(0) 推荐(0)
摘要: 1、对象数组 缺陷:类型固定,长度固定 //objarr.Student@1b6d3586 //objarr.Student 类型 //1b6d3586 地址 //未重写toString方法的类对象,输出对象的类型@地址 //重写了toString方法的类对象,输出toString的返回值 2、泛型 阅读全文
posted @ 2022-03-13 13:19 北极光zzZ 阅读(31) 评论(0) 推荐(0)