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



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. There is better way to fix this problem..
<

View Tutorial          By: Sundara Kaku at 2011-07-23 10:38:52

2. I just copied this example to my app. It's not wor
View Tutorial          By: Praveen Kumar at 2011-11-17 12:59:40

3. help me in my final project about arrays
View Tutorial          By: grace at 2013-03-13 09:54:11

4. hi how ru
anybody tell me that how to print

View Tutorial          By: imran at 2010-12-10 00:34:51

5. Thank alot
View Tutorial          By: Naganatarajan at 2010-01-07 05:54:17

6. Hi Chandra, you will have to download the winrar t
View Tutorial          By: Ramlak at 2008-08-08 00:14:40

7. It was really good.helped me a lot to get started.
View Tutorial          By: rohit at 2010-08-21 04:57:32

8. The above code works for me. When I run the progra
View Tutorial          By: Avinash at 2011-12-01 10:20:19

9. is anyone going to post the complete version of th
View Tutorial          By: anon at 2009-04-21 12:26:51

10. can for statement be used in a switch statement fo
View Tutorial          By: Osei Quadwo at 2014-10-08 20:12:17