public static String reverseStr(String str) {
int len = str.length();
char ch[] = str.toCharArray();
int begin = 0,end = len-1;
char temp;
while(begin<end) {
temp = ch[begin];
ch[begin] = ch[end];
ch[end] = temp;
begin++;
end--;
}
return new String(ch);
}
以上程序就是JAVA实现字符串反转的简单程序,非常简单,使用方便!!