Program On String Buffer Class in Java
AI-enhanced title
String s1 = sc.nextLine();
sb.reverse();
// comparing s1 and s2
if(s1.equals(s2)){
System.out.println(s1+" is pallindrome.");
else{
}OUTPUT: