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. I need a sample example using checkbox in struts.t
View Tutorial          By: Nandhu at 2011-02-25 07:45:39

2. nice
View Tutorial          By: knraju at 2012-04-13 13:49:57

3. hi,
please anyone tell me how to send bulk

View Tutorial          By: Nasrin at 2012-10-21 18:59:50

4. Thanks a lot for this great post.
View Tutorial          By: Ram Para at 2012-03-23 17:07:09

5. HI all,

I am not able to call SMSC

View Tutorial          By: chinnadurai at 2009-08-26 23:58:54

6. good
View Tutorial          By: Devil vampire at 2009-03-23 12:20:03

7. ,Hi, (VS2008, VB.Net
I used the above code,

View Tutorial          By: Pat at 2012-06-27 17:30:37

8. can I ask question? how to make a complete program
View Tutorial          By: manuel at 2012-08-13 10:06:24

9. hello sir , i m student of mca . i am working on S
View Tutorial          By: Pallavi at 2013-04-06 13:53:54

10. I'm trying to learn navigating between activities.
View Tutorial          By: Ben at 2012-01-17 23:42:38