摘要: List<Integer> nums 不能用 nums[rand.nextInt(nums.length)] 这种下标方式访问,因为 List 没有 length 属性,也不能用 [] 取值。 解决方法: 用 nums.size() 获取长度 用 nums.get(index) 获取元素 修改如下: 阅读全文
posted @ 2025-07-20 19:59 kuki' 阅读(4) 评论(0) 推荐(0)