I have always had this one issue with arrays of ArrayLists. Maybe you can help.
//declare in class
private ArrayList[] x;
//in constructor
x=new
Well, it seems you want to avoid the warning about Generics when you simply write
ArrayList[] x=new ArrayList[n];
as well as remove the compilation error, of x=new ArrayList
You can use the generic type >
to satisfy both the conditions, something like:
ArrayList> x[]=new ArrayList[n];
You might want to refer to the link below for knowing more about generics: https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html