Ответ 1
Вы можете сделать это в два этапа:
ArrayList<Element> tempElements = new ArrayList<Element>(mElements);
Collections.reverse(tempElements);
У меня есть массив объектов.
Можно ли создать новый массив, который является копией этого массива, но в обратном порядке? Я искал что-то вроде этого.
// my array
ArrayList<Element> mElements = new ArrayList<Element>();
// new array
ArrayList<Element> tempElements = mElements;
tempElements.reverse(); // something to reverse the order of the array
Вы можете сделать это в два этапа:
ArrayList<Element> tempElements = new ArrayList<Element>(mElements);
Collections.reverse(tempElements);