約55,500件1ページ目

日本語のみで絞り込む

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

  • 最終更新日:3か月以内
  • 12時間前 -Java Optional get() Method: returns the value, or throws an exception if the Optional is empty. Syntax, parameters and an example.

    2026/10/30 -The OptionalInt.toString() method returns a string representation of an OptionalInt object that may contain a primitive int value. Example: Program to ...

    2026/8/22 -In this article we learn how to create, inspect, transform, and read Optional values in Java. ... String> getCustomMessage() { return Optional.of("Hello there!

    2026/10/1 -Optional<String> value = Optional.of(str[2]); ​ System.out.println(value.get ... The get() method retrieves that value, hashCode() returns its hash ...

    4日前 -Optional is a container that either holds a value or holds nothing. It exists to make "there might be no result" a part of a method's signature instead 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/20 -Optional is a wrapper type and you obviously need to get the value out of its instance quite often. A straightforward way of doing that is to use get() .

    2026/10/10 -The difference between orElse() and orElseGet() is when the default value is computed. The orElse() method takes a ready value, so Java evaluates its ...

    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/9/18 -or() method of the Optional class returns the current Optional when a value is present. If the Optional is empty, it uses the supplied Supplier to obtain ...