I want to declare multiple arraylists but i failed to do so. Is there a way to it? here's my failed code:
List<Integer>[] table = new ArrayList<Integer>[]();
It seems no matter how and where do i put '[]', it just doesn't work. any help or suggestion would be appreciated
()as if you were calling a constructor, which you're not.)List<Integer> table = new ArrayList<Integer>()List<List<Integer>>instead.ArrayList<ArrayList<Integer>>- I'd just go withList<List<Integer>>, personally. Then you can addArrayList<Integer>references to it - or other implementations.