2 ms·
As I explained, List is an interface. You can't instantiate it, values are instances of types not interfaces. All that return type is telling you is, surprise,
by tialaramex 3y ago
As I explained, List is an interface. You can't instantiate it, values are instances of types not interfaces.
All that return type is telling you is, surprise, asList promises what you're getting implements the List interface. See if you can guess how you can implement the List interface using an Array. Still struggling, here's the one line of a typical implementation:
return new Arrays.ArrayList(a);
- thfuran 3y agoYou should at least try to be correct if you're going to be so insufferable about it.