Brian Goetz's Devoxx 2016 talk outlined several speculative future Java features. Data objects would auto-generate constructors, equals, hashCode, and toString from a compact class declaration. Value types (via Project Valhalla) would let developers define primitive-like types that are inlined in memory, eliminating pointer indirection and boxing overhead. Specialized generics would allow type parameters to range over primitives and value types (e.g., ArrayList<int>), backed by actual primitive arrays. Local variable type inference using 'var' would reduce boilerplate while keeping strong static typing. Pattern matching would extend switch to support type checks, object deconstruction, and use as an expression. A linked list example demonstrates all features together, showing dramatically reduced boilerplate and improved performance potential.

12m read timeFrom nipafx.dev
Post cover image
Table of contents
▚ Crash Course▚ Data Objects▚ Value Types▚ Specialized Generics▚ More Type Inference▚ Pattern Matching▚ Summary

Sort: