約5,030,000件1ページ目

日本語のみで絞り込む

2016/1/9 -I did some performance testing using an algorithm that heavily uses null checks as well as access to a potentially nullable field.

2025/2/20 -Optional introduces a small performance overhead compared to simply using null checks. While usually negligible, this overhead can become ...

2016/2/3 -As far as I can tell the most obvious difference is that the Optional requires creating an additional object. However, many people have started ...

2026/4/13 -NullPointerException is Java's most common runtime error. Optional does not eliminate it — but used correctly it moves the absence decision ...

2020/11/3 -1 ) On Performance: Wrapping primitive values into an optional instance shows noticeable degrading performance in tight loops. In Java 10 value ...

2021/6/15 -A variable whose type is Optional should never itself be null; it should always point to an Optional instance.” The primary intended use ...

2017/1/28 -But what we can measure is the performance impact. Or since I do not ... Optional is better to read than the old null checks. And if ...

2019/3/25 -Catching NPE is (almost) never a good idea. At least perform a null check. Let's make your example a bit better. Assume that UserRepository.

Java 8's Optional is a container object used to contain not-null objects. Optional object is used to represent null with absent value.

2026/2/2 -Three factory methods. Same result type. Wildly different behavior when null shows up. Optional.of() , Optional.ofNullable() , and Optional.