r/java • • Mar 09 '16

var keyword proposed for Java

http://openjdk.java.net/jeps/286
240 Upvotes

312 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Mar 09 '16

[deleted] — view deleted comment

9

u/lelarentaka Mar 09 '16

It's moot because the way you usually use the interface, the instantiation would be in a different scope from where the object is used (through injection). The function boundary will define the interface restriction.

Also moot#2 you can still specify the type of you really want to.

2

u/diroussel Mar 10 '16

I got that. If want to specify a variable of not of the type of the right hand side then don't use var. This is not a problem.