Answers for "allintitle:String palindrome in java using stringbuffer"

1

String palindrome in java using stringbuffer

// String palindrome in java using stringbuffer
public class PalindromeUsingStringBuffer
{
   public static void main(String[] args)
   {
      String strInput = "nayan";
      StringBuffer sb = new StringBuffer(strInput);
      sb.reverse();
      String str = sb.toString();
      if(strInput.equals(str))
      {
         System.out.println(str + " string is palindrome.");
      }
      else
      {
         System.out.println(str + " string is not palindrome.");
      }
   }
}
Posted by: Guest on February-22-2021

Code answers related to "allintitle:String palindrome in java using stringbuffer"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language