4 ms·
Good point. I see this as a good mechenism for allowing immutable lists (in which case it probably doesn't matter). But for mutable ones, you would probably w
by kentosi 17y ago
Good point. I see this as a good mechenism for allowing immutable lists (in which case it probably doesn't matter). But for mutable ones, you would probably want control over the datastructure.
The only way of allowing the programmer to do this, that I can think of for now, is by casting perhaps?
List<String> list = (LinkedList)["ham","eggs"];
Just an idea ...
- noss 17y agoList<String> list = new LinkedList<>(["ham","eggs"]);