public class Test { public static void main(String[] args) { String str0="abcdef"; str0=((new StringBuffer(str0)).reverse()).toString(); System.out.println(str0); } }
public class Test { public static void main(String[] args) { System.out.println(doChanged("abcde"));
{
StringBuffer sb = new StringBuffer("abcdefg"); System.out.println(sb.reverse().toString());
}
{
public static void main(String[] args)
{
String str0="abcdef";
str0=((new StringBuffer(str0)).reverse()).toString();
System.out.println(str0);
}
}
{
public static void main(String[] args)
{
System.out.println(doChanged("abcde"));
}
public static String doChanged(String str)
{
String s=new String("");
for(int i=str.length()-1;i>=0;i--)
{
s+=str.charAt(i);
}
return s;
}
===============
public class Test
{
public static void main(String[] args)
{
System.out.println(doChanged("abcde"));
}
public static String doChanged(String str)
{
String s=new String("");
for(int i=str.length()-1;i>=0;i--)
{
s+=str.charAt(i);
}
return s;
}
}
不是写出来了么?
if (shared) copy();
int n = count - 1;
for (int j = (n-1) >> 1; j >= 0; --j) {
char temp = value[j];
value[j] = value[n - j];
value[n - j] = temp;
}
return this;
}
jy02209334() ( ) 信誉:100 Blog
不是写出来了么?
=================
多种方法哈初学的话不能一味依赖库滴