Home » Sometech » WAP in JAVA that check whether a given string is a PALINDROM or not.

WAP in JAVA that check whether a given string is a PALINDROM or not.

Java Coding

class Palindrom

{

public static void main(String arg[])

{

String str = “abba”;

StringBuffer str1 = new StringBuffer(str).reverse();

String str2= str1. toString();

if(str. equalsIgnoreCase(str2))

System.out.println(“No. is Palindrom”);

else

System.out.println(“No. is not Palindrom”);

}

}

Advertisements

SoME Tech

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

%d bloggers like this: