What type is a var?

Main menu:

Topics

Recent Posts

Feeds

RSS Feed RSS - Posts

January 2019
M T W T F S S
« Dec    
 123456
78910111213
14151617181920
21222324252627
28293031  

Past Posts

Java/Java EE

JDBC

Other

Archive for the tag "tricky"

What type is a var?

December 25th, 2018 by Jeanne Boyarsky

Java 10 introduced “var” where the type of the variable is implied. This leads to some tricky scenarios. We first learn that “var” can replace the type. That means these two code blocks are equivalent. Ok. So far so good. Now we have this code: So we substitute var and the code no longer compiles! […]