Arraylist swap elements [duplicate] January 23, 2023 by Tarik You can use Collections.swap(List<?> list, int i, int j);