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. very cool you said it! many thanks it's really coo
View Tutorial          By: ArAsh at 2008-12-11 06:41:13

2. Easy to understand.good work
View Tutorial          By: Deepika at 2013-12-13 09:33:55

3. very nice example
View Tutorial          By: harshal at 2013-02-06 09:34:10

4. I have loaded allthe 5 java files.But how to imple
View Tutorial          By: Pandiyan at 2015-08-24 08:02:32

5. string is immutable in java.String buffer is mutab
View Tutorial          By: krishnakumar at 2009-10-19 00:35:44

6. gr8 help dude thankx a lot:-)
View Tutorial          By: Mr. Bond at 2011-12-09 19:21:36

7. Hai,
I have the same problem *** time out a

View Tutorial          By: Anitha at 2009-04-20 03:12:23

8. i am newly in java, i want to learn about this and
View Tutorial          By: gelen at 2010-11-23 02:57:15

9. i am MCA student and i have completed bca, so can
View Tutorial          By: shilam kumari at 2014-01-12 11:08:05

10. #!/bin/bash

echo "Enter number

View Tutorial          By: ashish at 2011-03-25 07:46:09