Here are 11 improvements you get when updating to #Java16 later today: from records and type patterns to `Stream`-additions and Unix domain sockets, from creating installers to more performance and observability. 🧵👇🏾 (Longer form with tons of links: nipafx.dev/java-16-guide/)
#1 Records Express in a single line that a type is just a collection of data without need for encapsulation and let the compiler do the rest: record Range(int low, int high) { } That results in almost the same API as the attached class. *drops mic*
#2 Type Pattern Matching This is actually two-for-one: * first step into pattern matching * type patterns with `instanceof` With a type pattern you check whether a variable is of a certain type and, if so, create a new variable of that type, so you can use it without casting.