We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, people. For example I have ArrayList with ten elements, and I have one new element. And I want to add that new element to the List, but I need to place it not in the end of the List, but for example between 5 and 6 element. So, my new element should become number 6, number 6 should become number 7 and so on.. How to do that?
Answers
List::set(idx, elem): https://Docs.Oracle.com/javase/8/docs/api/java/util/List.html#set-int-E-