Java检查Palindrome字符串 Java区分大小写的字符串比较 通过compareTo()比较Java字符串 Java检查Palindrome字符串 public class StringPalindrome { public static void main(String args[]) { String myString = "anna"; StringBuffer buffer = new StringBuffer(myString); buffer.reverse(); String data = buffer.toString(); if(myString.equals(data)){ System.out.println("Given String is palindrome"); } else { System.out.println("Given String is not palindrome"); } } } Java区分大小写的字符串比较 通过compareTo()比较Java字符串