Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8193259 JEP 323: Local-Variable Syntax for Lambda Parameters
  3. JDK-8202512

Release Note: JEP 323: Local-Variable Syntax for Lambda Parameters

XMLWordPrintable

    • Verified

      The reserved type name `var` can now be used when declaring the formal parameters of a lambda expression ([JEP 323](http://openjdk.java.net/jeps/323)). This builds on the ability in Java SE 10 to use `var` when declaring local variables.

      Using `var` for a formal parameter of a lambda expression causes the type of the parameter to be inferred, using the same rules as when neither `var` nor an explicit type is present. Lambda expressions have allowed their formal parameters to be declared without explicit types since Java SE 8.

      If `var` is used for any formal parameter of a lambda expression, then it must be used for all formal parameters of that lambda expression.

            vromero Vicente Arturo Romero Zaldivar
            vromero Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: