摘要:
int[]转Integer[] 代码解析: int[] arr1 = {1, 2, 3}; Integer[] arr2 = Arrays.stream(arr1).boxed().toArray(Integer[]::new); 1. Arrays.stream(arr1) Arrays.stre 阅读全文
int[]转Integer[] 代码解析: int[] arr1 = {1, 2, 3}; Integer[] arr2 = Arrays.stream(arr1).boxed().toArray(Integer[]::new); 1. Arrays.stream(arr1) Arrays.stre 阅读全文
posted @ 2025-03-30 22:20
码宝
阅读(74)
评论(0)
推荐(0)
摘要:
前缀和 前缀和又称累计和,是指将序列中从起始位置到当前位置的所有元素进行求和 prefixSum[0] = nums[0] prefixSum[1] = nums[0] + nums[1] prefixSum[2] = nums[0] + nums[1] + nums[2] ... prefixSu 阅读全文
前缀和 前缀和又称累计和,是指将序列中从起始位置到当前位置的所有元素进行求和 prefixSum[0] = nums[0] prefixSum[1] = nums[0] + nums[1] prefixSum[2] = nums[0] + nums[1] + nums[2] ... prefixSu 阅读全文
posted @ 2025-03-30 20:55
码宝
阅读(111)
评论(0)
推荐(0)
摘要:
类变量与类方法 static修饰的成员变量(类变量,静态变量)的特性? 同一个类所有对象共享 类变量是随着类的加载而创建, 所以即使没有创建对象实例也可以访问 ,但是类变量的访问, 必须遵守 相关的访问权限. static可以修饰类或者函数吗? 可以,使用static修饰的方法称为类方法或静态方法。 阅读全文
posted @ 2025-03-30 15:44
码宝
阅读(34)
评论(0)
推荐(0)

浙公网安备 33010602011771号