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 am getting following error

Error

View Tutorial          By: Pavan at 2009-11-26 21:31:22

2. crystal clear explanation
View Tutorial          By: digant at 2009-12-08 09:10:06

3. I am to learn J2ME
View Tutorial          By: ravi kumar at 2011-06-20 05:50:20

4. Hi,

Thanks for this example (glad t

View Tutorial          By: Thor at 2007-10-06 15:12:28

5. good for us
View Tutorial          By: soumen chakraborty at 2008-08-25 01:28:30

6. Good One..
View Tutorial          By: Subhranil Mukherjee at 2015-03-11 07:22:18

7. Hello, this is a very good post. I'm a newbee in J
View Tutorial          By: Brian at 2013-04-11 09:07:33

8. @Askia-Just change RadioButton1 to RadioButton2 in
View Tutorial          By: Nelson at 2010-03-06 23:12:36

9. Hii I m Ravi. This is a good example.
Here

View Tutorial          By: Ravi at 2011-02-17 09:09:06

10. Just read the first page, It really attractive. Le
View Tutorial          By: Md. Sumon Bappi at 2015-05-13 10:47:00