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/kcuf Mar 10 '16

That's what Scala does as well

List[String] list = someObject.someMethodString

or, more commonly seen as

List[String] list = someObject.someMethod[String]

1

u/normalOrder Mar 10 '16

I think you mean

val list = someObject.someMethod[String]

Or if you really want the type annotation

val list: List[String] = someObject.someMethod[String]

1

u/kcuf Mar 10 '16

Argh, ya, writing Java for work has been rotting my brain.