Trying to get the console output to tell me if a word is a palindrome
I am fairly new to java so this may be a simple solution but I am not sure how to do it myself.
package checkpalindrome;
import java.io.*;
public class CheckPalindrome
{
public static void main(String[] args) throws Exception
{
String input;
System.out.println("Enter a word");
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
input = br.readLine();
char[]try1=input.toCharArray();
for (int i=try1.length-1;i>=0;i--)
if (String.valueOf(try1)==input)
{
System.out.println(input +" is a Palindrome");
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
}