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. if i want to write my gmail address how can i prov
View Tutorial          By: asmcn at 2011-12-27 19:40:49

2. Pls put all this code in one folder(Full project d
View Tutorial          By: Guruprasada at 2011-09-15 07:27:57

3. I have altered the code as described (xml addition
View Tutorial          By: Spijker at 2015-10-14 12:27:47

4. i want to study java
View Tutorial          By: doshyo at 2007-12-13 07:41:03

5. how to read a number from a keyboard and write tha
View Tutorial          By: aiswarya at 2015-09-13 03:48:05

6. Right, so were is the tutorial files.zip?
O

View Tutorial          By: jeremy at 2011-10-24 15:58:40

7. thnks for the loop
View Tutorial          By: Benavidez,Jam at 2010-02-02 01:57:48

8. yes. Client needs to use printwriter, especially w
View Tutorial          By: Aksh at 2011-07-06 03:30:46

9. Good
View Tutorial          By: PRANJAL at 2015-08-14 16:38:57

10. Cool! Downloading the whole file with the HttpCon
View Tutorial          By: Luddite at 2010-06-26 12:26:26