You're correct about Java. It was an explicit decision that the only local variable's type declarations and lambda parameters may be inferred with `var`.
This excludes, as you mentioned, the return types of a function, its parameter's types, as well as the types of fields in a class.
This excludes, as you mentioned, the return types of a function, its parameter's types, as well as the types of fields in a class.