上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: 1 public static void main(String[] args) { 2 List<String> list = new ArrayList<>(); 3 list.add("张三"); 4 list.add("李四"); 5 list.add("王武"); 6 list.add(" 阅读全文
posted @ 2024-01-25 16:23 小※兽 阅读(41) 评论(0) 推荐(0)
摘要: 1 public static void main(String[] args) { 2 // Collection 集合获取 流 3 Collection<String> collection = new ArrayList<>(); 4 Stream<String> stream = colle 阅读全文
posted @ 2024-01-25 15:12 小※兽 阅读(7) 评论(0) 推荐(0)
摘要: 1 // 集合嵌套 2 public static void main(String[] args) { 3 // 要求程序记录每个学生选择的情况 4 // 使用一个map集合嵌套 5 Map<String, List<String>> data = new HashMap<>(); 6 7 // 阅读全文
posted @ 2024-01-24 23:00 小※兽 阅读(6) 评论(0) 推荐(0)
摘要: 1 public static void main(String[] args) { 2 // 学生选景点 a,b,c,d 四个景点,80个学生 3 String[] scene = {"A", "B", "C", "D"}; 4 StringBuilder sb = new StringBuild 阅读全文
posted @ 2024-01-24 21:48 小※兽 阅读(7) 评论(0) 推荐(0)
摘要: 1 public static void main(String[] args) { 2 // 添加元素:无序、不重复、无索引 3 Map<String,Integer> maps = new HashMap<>(); 4 maps.put("安踏",3); 5 maps.put("鸿星尔克", 1 阅读全文
posted @ 2024-01-24 21:19 小※兽 阅读(43) 评论(0) 推荐(0)
摘要: 1 public class CardDemo { 2 private String size; 3 private String color; 4 private int index; 5 6 public CardDemo(String size, String color, int index 阅读全文
posted @ 2024-01-24 19:46 小※兽 阅读(26) 评论(0) 推荐(0)
摘要: 1 public static void main(String[] args) { 2 // 自定义 泛型 3 String[] names = {"张三", "李四", "王文", "赵六"}; 4 printArray(names); 5 6 Integer[] age = {10, 20, 阅读全文
posted @ 2024-01-24 00:03 小※兽 阅读(6) 评论(0) 推荐(0)
摘要: 1 public class Test { 2 public static void main(String[] args) { 3 List<String> list = new ArrayList<>(); 4 list.add("张三"); 5 list.add("张三"); 6 list.a 阅读全文
posted @ 2024-01-23 23:34 小※兽 阅读(16) 评论(0) 推荐(0)
摘要: 1 public static void main(String[] args) { 2 // 冒泡排序 3 // 定义一个数组,存储一些数据 4 int[] arr = {5, 3, 1, 2, 9, 6}; 5 System.out.println(" 冒泡排序 "); 6 // 定义一个循环轮 阅读全文
posted @ 2024-01-23 20:09 小※兽 阅读(11) 评论(0) 推荐(0)
摘要: 1 public class InnerClass { 2 public static void main(String[] args) { 3 4 // 窗口 5 JFrame win = new JFrame("登陆界面"); 6 // 桌布 7 JPanel jPanel = new JPan 阅读全文
posted @ 2024-01-22 17:32 小※兽 阅读(3) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 10 下一页