Have something interesting to share with Java Eastern Europe community?
Become a speaker now
Nicolai Parlog

Nicolai Parlog

Independent Consultant, Germany

Nicolai is a thirty-year-old boy, as the narrator would put it (if he’s generous), who has found his passion in software development (mostly Java) and who codes for a living as well as for fun. He also blogs, writes, newsletters, speaks, chats, records, streams, trains, and consults about it – not all at the same time, but in prolific fits and starts with high throughput and long latencies. If you want to take the wheel, hire him for in-house trainings on new Java features, migrations to Java 9+, and JUnit 5. His home is at codefx.org.

Speaker's activity
Fun with `var`
Talk
English

“Since Java 10 you can use `var` to let the compiler infer a local variable’s type:

`var users = new ArrayList()`

And that’s pretty much it, right? Surprisingly, no! There are a lot of details to consider…

* is this JavaScript?!
* how exactly is the type inferred?
* where can I use `var` and what should I look out for?
* won’t this lead to unreadable code?

… and a few fun things to do with `var`…

* playing with anonymous classes (don’t!)
* faking traits (don’t!)
* faking intersection types (do!)

After this live-coding deep dive into `var`, you’ll know all about Java 10’s flagship feature.