Java Stream Filter and Count to Integer Conversion
"Java Saves.stream().filter(it -> !ObjUtil.isNull(it.getId())).count(); to Int" \n\nTo convert the result returned by "saves.stream().filter(it -> !ObjUtil.isNull(it.getId())).count();" to an int type, you can use the intValue() method. Modify the code as follows:\n\njava\nint count = (int) saves.stream().filter(it \-> !ObjUtil.isNull(it.getId())).count();\n
AI 优化版
原文地址:https://www.cveoy.top/t/topic/qh4t 著作权归作者所有。请勿转载和采集!