I've been working on a palindrome and it won't support an even number of words. I'm not the best at coding. It supports words like "racecar" or "tacocat", but it won't let me use a word/name like "Hannah". I'm new at this coding stuff so anything would really be appreciated.
import java.util.Scanner;
public class Palindrome
{
public static void main(String args [])
{
System.out.printf("\f");
Scanner input = new Scanner(System.in);
System.out.println("enter a word");
String word = input.nextLine();
int size = word.length();
int correct = 0;
int incorrect = 0;
for (int count = 1; count < size; count++)
{
int start = (word.charAt(count));//starting
int end = (word.charAt(size-count));//ending
if (start == end)
correct++;
else
incorrect++;
}
if (correct == 0)
System.out.printf("%s is a palindrome", word);
else
System.out.printf("%s is not a palindrome", word);
}
}