JDK-8065599 : 3.9: Introduce underscore as a keyword
  • Type: Sub-task
  • Component: specification
  • Sub-Component: language
  • Affected Version: 7,8
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-11-20
  • Updated: 2018-08-03
  • Resolved: 2016-09-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Description
In JLS 3.8. (Identifiers) change:
---
The "Java letters" include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). The $ sign should be used only in mechanically generated source code or, rarely, to access pre-existing names on legacy systems.
---
to:
---
The "Java letters" include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). As of Java SE 9 the underscore is no longer allowed as a one-character identifier. The $ sign should be used only in mechanically generated source code or, rarely, to access pre-existing names on legacy systems.
---
 
In JLS 3.9. (Keywords) add:
_
to the list of keywords
 
In JLS 15.27.1. (Lambda Parameters) remove:
---
It is a compile-time error if a lambda parameter has the name _ (that is, a single underscore character).
 
The use of the variable name _ in any context is discouraged. Future versions of the Java programming language may reserve this name as a keyword and/or give it special semantics.
---