搜索
首页 电脑/网络 程序设计 JAVA相关

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

全部回答

2018-04-07

0 0
    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。
    。

2018-04-07

54 0
    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)); } } 。

类似问题换一批

热点推荐

热度TOP

相关推荐
加载中...

热点搜索 换一换

电脑/网络
JAVA相关
程序设计
电脑装机
操作系统/系统故障
硬件
笔记本电脑
百度
互联网
反病毒
软件
程序设计
JAVA相关
数据库
C/C++
VB
C#/.NET
VC++
汇编语言
其他编程语言
JAVA相关
JAVA相关
举报
举报原因(必选):
取消确定举报