倒序应该是test a is this 如果你确定是test is a this,那么下面的代码对你没有帮助 public class Main{ public static void main(String[] args){ String str = "this is a test"; String[] words = str.trim().split(" "); for(int i = words.length-1;i>=0;i--){ System.out.print(words[i]+" "); } } } 再问: 对对对~~是test a is this~我打错啦~~谢谢你的回答!