上一页 1 ··· 3 4 5 6 7
摘要: 无参构造方法用的是自然排序,自然排序就是让所有元素所属的类实现Comparable接口,重写compareTo方法 Student.java 点击查看代码 import java.util.Comparator; import java.util.Objects; public class Stud 阅读全文
posted @ 2025-04-07 16:15 lfqyj 阅读(41) 评论(0) 推荐(0)
摘要: import java.util.ArrayList; public class Main { public static void main(String[] args) { boolean result = false; ArrayList arr = new ArrayList<>(); // 阅读全文
posted @ 2025-04-06 14:01 lfqyj 阅读(35) 评论(0) 推荐(0)
摘要: import java.util.HashMap; import java.util.Map; public class Test { public static void main(String[] args){ Map<String,String> m = new HashMap(); m.pu 阅读全文
posted @ 2025-04-03 20:43 lfqyj 阅读(55) 评论(0) 推荐(0)
摘要: public class Main{ public static void main(String[] args){ int[] a={1,6,2,4,8,7}; Arrays.sort(a); for(int i=0;i<a.length;i++){ System.out.println(a[i] 阅读全文
posted @ 2025-04-02 18:00 lfqyj 阅读(24) 评论(0) 推荐(0)
摘要: c=Math.max(a,b); d=Math.min(a,b); 阅读全文
posted @ 2025-04-02 17:48 lfqyj 阅读(14) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7