2 ms·
Why don’t just write var list = new ArrayList<Foo>()? The point of inference inside <> has always been to save you from repeating yourself from copying from the
by kaba0 4y ago
Why don’t just write var list = new ArrayList<Foo>()? The point of inference inside <> has always been to save you from repeating yourself from copying from the left to the right, which is a non-issue when you are saved from specifying it on the left.
- VagueMag 4y agoCompletely agree, but it did surprise me a bit and I didn't find much when I googled around for "don't mix var and the diamond operator."