Answer the question
In order to leave comments, you need to log in
Java. How to resize an ArrayList?
Hello! I'm building an application where the location of objects depends on their index in an ArrayList and I'm having a problem.
ArrayList expands when any objects are added to it:
list.add("Новая строка"); //Размер массива стал на единицу больше
list.add(0, "Новая строка"); //Данный объект был добавлен в массив под индексом 0
list.add(0, "Новая строка");
list.add(12, "Ещё одна новая строка"); //Не работает
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question