题目:写一个函数,将字符串反转,反转方式如下:“I am a student”反转成“student a am I,
总结了通过递归,非递归反转字符串代码,并做出两种不同的反转单词情况的代码,因为比较简单,直接上代码,看注释即可:
public class ReverseString {
/**
*
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner in =