KJUG #37 Local Variable Type Inference: Friend or Foe. Simon Ritter

Artur Wegrzyn
Kielce Java
Published in
2 min readNov 16, 2020

26 November 2020 @ Online

Link to event: https://us02web.zoom.us/webinar/register/WN_k-zjJUPSRpGhEQfGETd1sA

Talk #1 “Local Variable Type Inference: Friend or Foe.” by Simon Ritter

Abstract

Local variable type inference was introduced as a new Java language feature in Java SE 10. Gone are the days of explicitly having to define the type of a variable; let the compiler do it for you with the magic of var!
At first sight, this looks like a small change that will eliminate unnecessary boiler-plate code and reduce how much typing (on the keyboard) is required to maintain strong typing (of the language). However, as with many features, there are some unexpected nuances as well as both good and bad use cases.
In this session, we’ll explain the fundamentals of local variable type inference. We’ll then take a series of examples of the use of var and discuss the technical merits of each case.

Bio

Simon Ritter is the Deputy CTO of Azul Systems. Simon has been in the IT business since 1984 and holds a Bachelor of Science degree in Physics from Brunel University in the U.K. Simon joined Sun Microsystems in 1996 and started working with Java technology from JDK 1.0; he has spent time working in both Java development and consultancy. Having moved to Oracle as part of the Sun acquisition, he managed the Java Evangelism team for the core Java platform. Now at Azul, he continues to help people understand Java as well as Azul’s JVM technologies and products. Simon has twice been awarded Java Rockstar status at JavaOne and is a Java Champion. He currently represents Azul on the JCP Executive Committee and on the Java SE Expert Group.

Sponsors

The main event’s and founding sponsor of KJUG is Virtus Lab.

IDE licenses are sponsored by Jet Brains: developers of the best Java IDE in the world :)

And as always, Manning Publications is a sponsor of books for Meetup attendees.

--

--