package com.imooc;
class ReverseStr {
public static String reverseIt(String source){
int i,len=source.length();
StringBuilder dest=new StringBuilder(len);
for(i=(len-1);i>=0;i--){
dest.append(source.charAt(i));
}
return dest.toString();
}
}
class Myrever{
public static void main(String[] args){
System.out.println("abcdefg is reversed to:"+ReverseStr.reverseIt("abcdefg"));
}
}
qq_蓝色冰点水_0
相关分类