Class Unit


  • public final class Unit
    extends Object
    The type with only one value: the Unit object. Used when Void cannot be used (for example needs a non-null value).

    Is immutable, supports equals/hashcode (since it's a singleton reference equality).

    Same in rust: https://doc.rust-lang.org/nightly/std/primitive.unit.html

    Same in kotlin: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html

    • Method Detail

      • get

        public static Unit get()