|
|
|
|
|
by kinghajj
3030 days ago
|
|
Yes, but in current Java one would have to write ArrayList<String> foo = new ArrayList<String>() Or, at least List<String> foo = new ArrayList<String>() Whereas with `var`, as you show, the compiler infers the type. Proponents of this point out exactly what you did: the type is right there, so why should the programmer have to write it twice? |
|
n,<return>,A,r,L,<return>,S,t,r,<return>,Cmd-Option-V,<return>
The IDE autocompletes everything, extract-to-variable does most of the heavy lifting.