public static void main(String args[]){ //按空格分割 并倒叙输出 String str = "hello nice to mite you"; String arr[] = str.split(" "); for(int i=arr.length-1; i>=0; i--){ System.out.println(arr[i]); } //按空格分割并正常输出 String str1 = "hello nice to mite you"; String arr1[] = str1.split(" "); for(int i=0; i<arr1.length; i++){ System.out.println(arr1[i]); } }