62,614
社区成员
发帖
与我相关
我的任务
分享
import java.util.Date;
public class Demo1 {
public String fun(String s)
{
//将字符串倒序显示
//...?
}
public static void main(String[] args) {
String s="hello,world";
Demo1 demo1=new Demo1();
System.out.println(demo1.fun(s));
}
}
public class Demo1 {
public String fun(String s)
{
//将字符串倒序显示
//...?
StringBuffer sb=new StringBuffer(s);
sb.reverse();
return sb.toString();
}
public static void main(String[] args) {
String s="hello,world";
Demo1 demo1=new Demo1();
System.out.println(demo1.fun(s));
}
}