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. Thanks it worked for me after lot of search for CO
View Tutorial          By: VIRAJ at 2012-12-26 11:56:24

2. thank you sir
View Tutorial          By: sivaranjani at 2015-01-30 01:15:40

3. plz answr for questions about time out problem whl
View Tutorial          By: rrai at 2013-08-26 06:06:57

4. can you plase give an exmple of what should i put
View Tutorial          By: Or at 2013-02-16 11:32:17

5. Good
View Tutorial          By: sirisha at 2009-09-08 23:04:22

6. its not solve my problem.i.e
the concept is

View Tutorial          By: murli at 2010-10-02 23:23:11

7. Very nice
View Tutorial          By: sharath at 2012-07-17 11:31:20

8. Can someone tell me how to run in linux 7.10...
View Tutorial          By: fatwa perdana at 2008-10-15 03:27:49

9. Neatly explained about the three important functio
View Tutorial          By: Jitendra Lenka at 2011-02-03 06:34:10

10. but need in the case of radio buttons
View Tutorial          By: vishnu at 2011-07-21 11:39:26