Is there any difference between initialization via:
MyWrapper<String> wrapper = new MyWrapper<String>();
vs initialization via:
MyWrapper<String> wrapper = new MyWrapper<>();
Is there any reason why one would want to use the former over the latter? I see a lot of the former; I'm not sure if it's just because that's what people are used to, or there's a reason you'd want to write it that way.
The latter is only available since Java 7. That's why you often see the former. The latter is equivalent, and shorter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With