Comment on Tutorial - Palindrome String in Java By Grant Braught



Comment Added by : Palla Subramanyam

Comment Added at : 2012-01-25 20:18:03

Comment on Tutorial : Palindrome String in Java By Grant Braught
The one more best way is

public class Palindrome {
static public String pal(String str, int i, int j){
if(str.length()/2 != i)
if(str.charAt(i)==str.charAt(j))
pal(str,++i,--j);
else
return "String is Not palaindrome";

return "String is palaindrome";
}
public static void main(String[] args) {
String str = args[0];
System.out.println(pal(str,0,str.length()-1));
}
}


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. Appriciated, The information is very useful and st
View Tutorial          By: Bala Gummadi at 2009-02-24 10:01:50

2. Indent your code, man.
View Tutorial          By: Jenga at 2009-02-16 17:30:07

3. very nice thank you so much my dude
View Tutorial          By: mohd at 2010-07-28 02:40:23

4. hi! i want to know about how database createed in
View Tutorial          By: kundan at 2010-05-19 05:03:33

5. I am quite new to Struts and this article, quite c
View Tutorial          By: Jenghiz at 2010-01-27 23:19:48

6. hey hiii.
at last the progrma has be runnin

View Tutorial          By: jugal at 2009-02-20 08:22:31

7. this tutorial example of inheritence is taken from
View Tutorial          By: vinod kumar gaur at 2011-07-17 23:18:00

8. this code is not working properly buddies. please
View Tutorial          By: hammad at 2011-06-10 01:53:39

9. Unfortunatelly this a BAD example of to communicat
View Tutorial          By: Mladen Covic at 2013-03-28 15:08:04

10. it is working....great
View Tutorial          By: mahesh maduranga at 2011-03-27 23:01:57