emptyArray = _objectWrappers.wrap(_arrays.arrayOf(_plugins.loadClass("java.lang.Long"))) # 查找数组中的最大值,如果数组为空,则返回 None maxValueOrNull = emptyArray.maxOfOrNull(lambda it: it) # 输出:最大值(或 None): None _console.log("最大值(或 None): ", maxValueOrNull)