Could someone please point out the mistake in my program?
The output is always: "it is not a palindrome"
String newstr="";
for(int j=length-1;j>0;j--)
{
char m=str.charAt(j);
newstr=newstr+m;
}
if(newstr.equals(str) )
System.out.println("it is a palindrome");
else
System.out.println("it is not a palindrome");
thanks in advance:)