Program to Check Whether the given string is palindrome or not in java

1.Write a program to check whether the given string is palindrome or not.


import java.io.*;
import java.lang.*;
class Palindrom
{
public static void main(String args[])
{
int p=0; int n=args[0].length();
for(int i=0;i<n;i++)
{
if(args[0].charAt(i)!=args[0].charAt(n-i-1)) 

p=1;
}
if(p==0)
 System.out.println("The given String is a Palindrome");
else
System.out.println("The given String is not a Palindrome");
}
}