top | item 45403350

(no title)

moefh | 5 months ago

There's no dropping of type requirements in Java, `var` only saves typing.

When you use `var`, everything is as statically typed as before, you just don't need to spell out the type when the compiler can infer it. So you can't (for example) say `var x = null` because `null` doesn't provide enough type information for the compiler to infer what's the type of `x`.

discuss

order

procaryote|5 months ago

> `var` only saves typing.

this is a lovely double entendre