約15,400件1ページ目

日本語のみで絞り込む

条件を指定して検索しています。すべての条件を解除する

  • 最終更新日:3か月以内
  • 2026/10/1 -Optional.ofNullable(value): Creates an Optional containing the value if it is non-null; otherwise, returns an empty Optional. Example 1: Using empty() and of().

    2026/9/16 -Optional in Java replaces null checks and helps avoid NullPointerException. Added in Java 8: learn why it exists and how of() differs from ofNullable().

    2026/8/22 -Optional.ofNullable is used when the argument may be null . It creates an empty Optional for a null argument. Simple example.

    2026/9/24 -If the value is null, it returns an empty Optional instead. ... Example: Program to demonstrate how ofNullable() creates an Optional for a non-null value.

    2日前 -The most common Optional anti-pattern is wrapping a potentially null value in an Optional , only to immediately invoke .get() without checking if a value is ...

    2026/8/20 -Optional helps in representing a case of missing value. For example, if you ask a person about their email address, they may or may not have an email. So if you ...

    2026/9/28 -Optionalのメソッド早見表 ; nullかもしれない値から作る, Optional.ofNullable(value), Java 8 ; 空を作る, Optional.empty(), Java 8 ; ないときの値を指定して取り出す ...

    14時間前 -Java Optional methods: create an Optional, check if it holds a value, get the value or a default value, and change the value with map() and filter().

    4日前 -Null is the default in the Java, and it is unchecked. Nothing in the type system warns you that a lookup might fail. The result is that a null can travel a long ...

    3日前 -Java 8 adds the Optional<T> class, giving developers a way to explicitly signal that a value might be absent, rather than silently returning null. 2017+. Modern ...