📜  反向数组列表 java 递归 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:16.385000             🧑  作者: Mango

代码示例1
public ArrayList reverse(ArrayList arrayList) {
    if(arrayList.size() > 1) {                   
        Object value = arrayList.remove(0);
        reverse(arrayList);
        arrayList.add(value);
    }
    return arrayList;
}