First contact with 'var' in Java 10





The interactive transcript could not be loaded.


Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Nov 15, 2017

Java 10 will be released in March 2018 and it comes with local-variable type inference, which means we can use 'var' instead of a type name when declaring local variables. In this video I tell you how to use 'var', where it works and where it doesn't (and why) and how it might impact readability.

I wrote a blog post on the same topic (http://blog.codefx.org/java/java-10-v...) and created a Java 10 demo project (https://github.com/CodeFX-org/demo-ja...), which also documents how to set up JDK 10.

For much more on software development, Java, and the JVM, subscribe to this channel, follow me on Twitter (https://twitter.com/nipafx), or have a look at CodeFX (http://codefx.org). If you're interested in courses on Java, particularly Java 9 and 10, check out http://courses.codefx.org.


* 0:11 introduction
* 0:47 where var works
* 2:49 no, this is not dynamic typing
* 4:08 how var works
* 4:57 "action at a distance" errors
* 7:41 technical limitations of var
* 9:51 design limitations of var
* 13:09 impact on readability
* 17:31 summary


to add this to Watch Later

Add to

Loading playlists...