5 ms·
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
by moefh 1y 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`.
- procaryote 1y ago> `var` only saves typing. this is a lovely double entendre