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. help to place a menu inside a menu
View Tutorial          By: sandy at 2009-07-29 05:57:28

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

3. I need some help. I am a programmer - but quite n
View Tutorial          By: Ron at 2013-06-21 00:58:27

4. I get this error:
Can someone please help m

View Tutorial          By: Carlos at 2010-06-14 02:42:53

5. Hi Sir...
sir i am working on Speech to Tex

View Tutorial          By: Sadaquat at 2012-08-19 07:51:28

6. really this introduction makes me very interesting
View Tutorial          By: Himaja Reddy at 2012-11-09 06:57:31

7. I am using my samsung s5233 via usb connection, ru
View Tutorial          By: Puneet at 2010-04-23 06:14:28

8. Thanks a lot this thing was very importent for me!
View Tutorial          By: Andrew at 2010-05-23 01:47:04

9. @Srini

Hi Srini, I can answer your

View Tutorial          By: Sudev Wilson at 2015-04-08 12:23:33

10. I dont know the reason why have a exception!

View Tutorial          By: Nguyen Tien Viet at 2008-04-05 06:01:50