提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
如何反转数组
import java.util.Collections; import java.util.List;/**来 自 nowjava.com - 时代Java**/ import java.util.Arrays; public class Main { public static void main(String args[]){ String[] strDays = new String[]{"Sunday", "Monday", "Tuesday", "Wednesday"}; List<String> list = Arrays.asList(strDays); Collections.reverse(list); strDays = (String[]) list.toArray(); System.out.println("String array reversed"); for(