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. s1==s2 is not true. its false. run the program and
View Tutorial          By: arpita at 2009-05-18 23:50:11

2. its very good example explains what is an abstarct
View Tutorial          By: sandeep at 2012-01-06 07:13:29

3. thanks
View Tutorial          By: Tejaswini C at 2011-12-23 17:57:03

4. hiiiii
View Tutorial          By: hiiiiii at 2010-07-28 14:08:50

5. Assalamu alaikum saaliya sir,

Could

View Tutorial          By: Jaffer sulaiman at 2014-08-23 06:01:20

6. thanks for this example
View Tutorial          By: hai at 2011-12-16 05:36:14

7. Great! Thanks :)
View Tutorial          By: Shivang at 2010-10-10 11:53:54

8. Nice article...
View Tutorial          By: Sudhanshu at 2012-08-02 06:19:42

9. how do i write the above same code using ajax and
View Tutorial          By: Karthik at 2011-08-29 11:21:45

10. Really nice explanation...
nice to understa

View Tutorial          By: Parth Kansara at 2011-06-21 02:11:52