爱问知识人 爱问教育 医院库

请教JAVA编程题“编程实现反转一个字符串并输出”

首页

请教JAVA编程题“编程实现反转一个字符串并输出”


        

提交回答
好评回答
  • 2005-12-16 17:39:56
      StringBuffer的常用方法
    public int capacity()
    这个方法返回字符串缓冲区的当前容量。
    public synchronized StringBuffer reverse()
    这个方法反转字符串缓冲区中的字符串
    public int length()
    这个方法返回缓冲区中字符的个数
    public synchronized setLength(int newLength)
    这个方法设置字符串缓冲区的长度。
       public synchronized charAt(int index) 这个方法返回字符串缓冲区中指定位置的字符 public synchronized void setCharAt(int index,char ch) 这个方法将字符串缓冲区中指定位置的字符设置为ch。
      

    祥***

    2005-12-16 17:39:56

其他答案

    2005-12-20 20:58:55
  • import  .*;
    public class daoxu{//类名
    public static void main(String args[]){
    BufferedReader br =new BufferedReader(new InputStreamReader( ));
    String string=" ";
    try{
    string= adLine();
    }
    catch(IOException ex){
     intln(ex);
    }
    for(int i=string.length()-1;i>=0;i--)
     int( arAt(i));
    }
    } 

    1***

    2005-12-20 20:58:55

类似问题

换一换

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 176-195
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):