肯定不是相等的
虽然显示的结果是一样的其实并不一样
str1应该是“12321     ”
而str2应该是“     12321”
结果当然不一样了

解决方案 »

  1.   

    把System.out.print ( "The string is : " + str1 );
    改成  System.out.println ( "The string is : ");
          System.out.println (str1);把System.out.println ( "The other string is : " + str2 );
    改成  System.out.println ( "The other string is : ");
          System.out.println(str2 );就可以看到结果了:
    你预想的结果应该是: 
    The string is :
    12321
    The other string is :
    12321
    是回文而运行结果是
    The string is :
    12321The other string is :12321
    不是回文
    中间多处空行