r/programming • • Mar 09 '16

var keyword proposed for Java

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

395 comments sorted by

View all comments

Show parent comments

-1

u/doom_Oo7 Mar 10 '16

With the explicit type I only have to know what a CustomerValidationResponse is.

No, because it might return a type that is implicitely convertible to CustomerValidationResponse and where the conversion has side-effects. So you still have to check it, while in the var case you know that the variable is of the type of the return of the function.

2

u/id2bi Mar 10 '16

There are implicit conversions in Java?

1

u/doom_Oo7 Mar 10 '16

I thought that there were but it seems that there aren't. Oh well !