List is an interface and cannot be instantiated, so new List
will trigger a compile-time error. You can do ArrayList columnList = new ArrayList(n);
, but this way you can't easily switch between different List
implementations(ArrayList
is one of them).