SyntaxFix
Write A Post
Hire A Developer
Questions
The [] makes no sense in the moment of making an ArrayList of Integers because I imagine you just want to add Integer values. Just use
[]
List<Integer> list = new ArrayList<>();
to create the ArrayList and it will work.