約41,700件1ページ目

日本語のみで絞り込む

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

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

    2026/10/1 -Here, Optional.of(str[2]) stores a value inside the Optional object. The get() method retrieves that value, hashCode() returns its hash value, and isPresent ...

    2026/8/23 -Optional type from Java helps in representing the case of missing value. ... We also see orElse() which is used to get value from Optional object with a default.

    2026/8/22 -In this article we learn how to create, inspect, transform, and read Optional values in Java. Optional is a container object that may or may not contain a value ...

    2026/10/30 -The toString() method of the Optional class in Java returns a string representation of an Optional object. It helps developers identify whether the Optional ...

    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/10/10 -Both orElse() and orElseGet() return the value of a present Optional and a default for an empty one. The orElse() method takes the default as a value, so ...

    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 ...

    4日前 -In the HashMap chapter, you used get() to find a value by its key. But what if the key does not exist? Then get() returns null , which means "no value". If you ...

    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 ...