JEP 302: Underscore as enhanced for loop parameter?

Tagir Valeev amaembo at gmail.com
Wed Nov 1 17:05:54 UTC 2017


Hello!

It's already implemented in amber repository.

With best regards,
Tagir Valeev.


1 нояб. 2017 г. 13:05 пользователь "Zheka Kozlov" <orionllmain at gmail.com>
написал:

The feature that I have always missed in Java is a possibility to ignore a
parameter in `catch`:

try {
    // code
} (NumberFormatException ignored) {
    // code
}

I think an underscore is a perfect fit for this:

try {
    // code
} (NumberFormatException _) {
    // code
}


More information about the amber-spec-observers mailing list