How to remove the brackets [ ] from ArrayList#toString()?

后端 未结 11 2352
攒了一身酷
攒了一身酷 2021-01-03 14:09

I have created an Array List in Java that looks something like this:

 public static ArrayList error = new ArrayList<>();

for (int x= 1         


        
11条回答
  •  清酒与你
    2021-01-03 14:56

    This is an ArrayList of Integer. This ArrayList can not contain a character like '['. But you can remove an Integer from it like this -

    error.remove(3);
    

提交回复
热议问题