package lab10_4;
/**
*
-
@author Administrator
*/
import java.util.Scanner;
public class Lab10_4 {/**
-
@param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner scan=new Scanner(System.in);
System.out.print("请输入一个字符串:");StringBuffer s=new StringBuffer(scan.nextLine());
System.out.print("逆序后的字符串是:");
StringBuffer s1=new StringBuffer("");
for( int i=s.length()-1;i>=0;--i){
System.out.print(s.charAt(i));
s1.append(s.charAt(i));
}
s1.toString();
s.toString();
System.out.println();
System.out.print(s.equals(s1));
}
-
}
为什么输出的是false