Comment on Tutorial - Palindrome String in Java By Grant Braught



Comment Added by : Manoj

Comment Added at : 2013-01-07 02:18:00

Comment on Tutorial : Palindrome String in Java By Grant Braught
simple way friends:
public class palindrome {
public static void main(String[] args) {
String s="malayalam";
int count=0;
int gee=0;
for(int i=0;i<s.length()/2;i++)
{
char[] f=s.toCharArray();
if(f[i]==f[s.length()-1-i])
{
count++;
}
else
{
gee++;
}
}
if(gee>0)
{
System.out.println("not palindrome");
}
else
{
System.out.println("palindromr");}
}

}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Got follwoing error.


javax.

View Tutorial          By: Amit Sinha at 2013-11-26 08:35:00

2. I think this code is just simple enough to be foll
View Tutorial          By: WAQ at 2010-11-24 10:41:58

3. it's cool
but on other way it is indeed har

View Tutorial          By: johncarlo at 2009-02-05 04:44:13

4. Good article..
View Tutorial          By: Sudarshan at 2011-03-28 02:57:53

5. guys i am getting this error..plz tell me the solu
View Tutorial          By: Ajit at 2010-06-17 07:38:51

6. Travis could you share steps to configure correctl
View Tutorial          By: Shailesh S. at 2015-09-09 09:36:20

7. i've run d program and its works
View Tutorial          By: okeaghala nneka at 2012-03-31 10:58:13

8. thanks a lot
View Tutorial          By: Uzzal biswas at 2014-11-04 02:42:54

9. output is not specified there.., it must should be
View Tutorial          By: yash at 2014-09-17 16:35:52

10. Great Job
View Tutorial          By: Niteen Dhule at 2015-02-09 06:37:03