Hi i'm new here in daniweb i would like to ask about my program
i'll make a program that show if the word is palindrome or not can you correct my program when i complie my program its say Process complete then when i run the program it doesn't show the output can you help me pls!
import javax.swing.*;
public class Palindrome
{
public static void main(String[] args)
{
String A;
int i,palindrome=1;
A=JOptionPane.showInputDialog(null,"Enter a Word");
for(i=0;i<A.length()/2;++i)
{
if(A.charAt(i)!=A.charAt(A.length())-i-1)
{
palindrome=0;break;
}
if(palindrome==1)
System.out.println("The Word "+A+" is a Palindrome");
else
System.out.println("The Word "+A+" is not a Palindrome");
}
}
}