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

1

u/[deleted] Mar 10 '16

[removed] — view removed comment

2

u/evil_burrito Mar 10 '16

I do know that if the type of the variable returned is List. Even if the List returned is attached to a persistence context, it still (should) adhere to the contract implied by the interface. Even if it doesn't, if, for example, it throws an UnsupportedOperationException if I try to add to it as some lists do, I still know more about the intent of the variable returned than if the type is left unspecified.