Yes, the problem goes to 1.5 and above. It seems that the question is not completely resolved, although I am adding my 2 cents in case anyone comes across this question. This mainly concerns this part of the question:
I did not create a general list of arrays; I made a list of string arrays.
Error message:
> ArrayList type is not common; it cannot be parameterized with arguments <String>
> Syntax error, parameterized types are only available if source level 5.0
What this actually means, since Java 1.5 we can also use type parameters (where parameter values ββwere used in one of them). JDK 1.5 introduces generics that allow us to abstract from types (or parameterized types ).
Class designers can be generic types in a definition. The arrayList implementation will look like this:
public class ArrayList<E> implements List<E> .... { // Constructor public ArrayList() {...} // Public methods public boolean add(E e) {...} public void add(int index, E element) {...} public boolean addAll(int index, Collection<? extends E> c) {...} public abstract E get(int index) {...} public E remove(int index) {...} ... }
Where E can be any type, like String or Integer, etc. Therefore, the name is a generic array of List.
Users can be specific in types when creating an object or calling a method that was executed in this example, as shown below:
ArrayList<String> list = new ArrayList<String>();
(This was a confusion in the above case, if I am not mistaken :-))
An example of using generics (if necessary):
Where E is the return type of the object. This can be used for the entire beans model defined in the system, which makes it common.
Hope this helps.
Link: Java Programming Tutorial - General