如果Optional中有包含值,還可以再針對元素做處理: Optional.ofNullable(name).map(String::length); //回傳Optional<Integer> Optional.ofNullable(name).ifPresent ...
確定! 回上一頁