How are you getting the input? Scanner class? Does the professor want you to capture
each char the user enters and store in a char array?
Here what I've would done
//imports, class naming, etc...w/e!
public static void main(String[] args)
{
java.util.Scanner scanner = new java.util.Scanner(System.in);
char[] input = scanner.next().toCharArray();
if(input.length > 30)
throw new Exception("TOO BIG!!!");
char[] reverseInput = new char[input.length];
for(int x = 0, i = input.length -1; i > 0; i--, x++)
reverseInput[x] = input[i];
for(int x = 0; x < input.length; x++)
{
if(reverseInput[x] != input[x])
{
System.out.prinln("Not a Palindrome!");
System.exit(0);
}
}
System.out.prinln("It's a Palindrome!");
} I did not compile it so there might be errors but that is along the lines of what I would do. I don't know if you're allowed to do this.