import java.util.Scanner;
public class m_Test {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入一个字符串:");
String s = sc.nextLine();
System.out.println("字符串的长度:"+s.length());
StringBuffer sb = new StringBuffer(s);
System.out.println("字符串逆序:"+sb.reverse());
}
}
05-15
3497
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-06
317
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-06
4145
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)