What type is a var?

Main menu:

Topics

Recent Posts

Feeds

RSS Feed RSS - Posts

December 2018
M T W T F S S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Past Posts

Java/Java EE

JDBC

Other

Archive for December 25th, 2018

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! […]