4 ms·
I've been doing List<String> list = new ArrayList<>(); Isn't that good enough?
by arrty88 11y ago
I've been doing List<String> list = new ArrayList<>();
Isn't that good enough?
- hyperpape 11y agoNo. The List<String> is almost as redundant as the RHS <String> was.
- the_af 11y agoFor your example, it makes no difference. However, take a look at the other example mentioned at the beginning: var stream = list.stream(); // infers Stream<String> How would you write it in order to take advantage of type inference?