Class auto


  • public final class auto
    extends Object
    Serves as the pseudo keyword auto, which declares a field, local, or method as having its type inferred from its value/definition.

    A field or local variable declared as auto infers its type from the initializer. The behavior is similar to Java's 'var'.

    A method with return type auto infers its return type from the return statements in its definition. As a consequence, fields and methods declared in the inferred type are type-safely accessible to call-sites.