2 ms·
With Lmobok, you can use `var` for local variables, and it will infer the type for you. It also can produce default constructors of various kinds. Can't have n
by nine_k 7y ago
With Lmobok, you can use `var` for local variables, and it will infer the type for you. It also can produce default constructors of various kinds.
Can't have nice syntax for object literals, maps, slices, etc, though :( I mean, I have no hope for it to be introduced to the language any time soon, even if the desire is there among the language stewards.
- apta 7y ago> With Lmobok, you can use `var` for local variables `var` is part of standard Java, you don't have to use Lombok. > Can't have nice syntax for object literals Could you elaborate on what you mean by object literals in this context?
- nine_k 7y agoSome shops are still not Java 10, but Lombok helps you use `var` even there.
- nine_k 7y agoObject literals: think JavaScript. const foo = new Bar a = 1, b = 2 } With a default constructor or a builder (both provided by Lombok, maybe with other libraries, too) this level of succinctness is quite achievable in Java, too.