anybody out there please help me out fix these bug in my code. i really couldnt figure out what's wrong with my code.
input should be in a string, and the output should tell wether its a palindrome or not
please!
import java.lang.*;
import java.util.*;
import java.io.*;
public class istak
{
public static void main(String[] args)throws IOException
{
InputStreamReader wee= new InputStreamReader(System.in);
BufferedReader stndin= new BufferedReader(wee);
String word;
Stack s= new Stack();
int i,count=0;
System.out.print("\nInput string: ");
word=stndin.readLine();
char array[]=word.toCharArray();
for(i=0;i<array.length;i++)
{
char val=array[i];
s.push(val);
}
for(i=0;i<array.length/2;i++)
{
char nxt=array[i];
char temp=s.pop();
if(nxt==temp)
{
count++;
}
}
if(count==array.length/2)
{
System.out.println("PALINDROME");
}
else
{
System.out.println("NOT PALINDROME");
}
}
}