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. it shows error
java.lang.NoClassDefFoundEr

View Tutorial          By: vamsi at 2010-05-14 23:09:03

2. wow , really good java sample , and i suggest to s
View Tutorial          By: kiemtheng at 2011-08-31 13:31:32

3. thanks, i will try. but can u tell me how to send
View Tutorial          By: ketut joko wibawa at 2011-01-02 05:18:01

4. i Want Struts Full Details with
Word forma

View Tutorial          By: Kannan.R at 2007-10-04 00:40:27

5. How to fetch a value from a database in dropdown b
View Tutorial          By: lara at 2014-11-19 09:02:43

6. As C does not support Function Overloading, there
View Tutorial          By: N at 2013-03-06 00:27:14

7. Please send the complete code.. thanks!
View Tutorial          By: Roger22 at 2010-03-11 00:41:07

8. I want to know more about Java Garbage collection,
View Tutorial          By: Prosenjit Kundu at 2010-05-08 09:42:40

9. if done all the steps but i have found out this er
View Tutorial          By: hisham at 2010-11-24 11:01:54

10. pls send to me example about stacks
becaus

View Tutorial          By: suliman at 2011-12-10 08:02:01