Project Amber is making progress on pattern matching in #JavaNext. Here are three recent developments that I'm very excited about and I think you will be as well. (Caveats: these are ongoing discussions; none of this is final; speculation and strawman syntax ahead)
1
8
25
0
1
Download Image
1. "Array patterns" allow matching and destructuring arrays. The `if`-line does three things: a) is `objects` a `String` array with length 2? b) if so, cast it to `String[]` and extract the two elements c) declare `a` and `b` and assign the two elements to them