I'll just elaborate a bit more on @Legato's@Legato's point that "pretty much all your code is in main". Your program flow is now roughly like the following:
Greet user
(A) Ask whether to check for a palindrome or not
(B) Get input if "yes"
(C) Check for palindrome
(D) Print result
(A) Ask whether to check for a palindrome or not
(B) Get input if "yes"
(C) Check for palindrome
(D) Print result
...
As you can see, (A) and (B) can be done in its own method that returns a String, e.g.
private static String getInput() {
// (A) prompt whether to check palindrome or not, while ensuring yes/no input
if (answer.equals("no")) {
return "";
} else {
// (B) answer = another prompt for a non-empty String
return answer;
}
}
(C) can simply be in its own method, that returns a simple boolean to indicate if the input is palindromic or not. All checks can be done within the method.
private static boolean isPalindromic(String input) {
// (C) return true or false
}
As for (D), the console output should also be isolated from the palindromic checking, because both are mutually exclusive. Another (theoretical) way of looking at this is that you may want to replace the output with a file write-out, for example. Putting them all together, your main will probably look something like this:
public static void main(String[] args) {
String input = "";
while (!(input = getInput()).isEmpty()) {
if (isPalindromic(input)) {
System.out.println("Yes, this is palindromic.");
} else {
System.out.println("Sorry, this is not palindromic.");
}
}
}