I have found a way to make my program recognize if something is a palindrome or not, but when it is not, the program will not repeat.
I already have the boolean section of this implemented before my provided code.
Originally was set with if statements, wanted to replace with while but something like while (!yespalin(potentialp)) doesn't work either
Scanner scan = new Scanner(System.in);
String potentialp;
System.out.println("Please enter a potential palindrome: ");
potentialp = scan.nextLine();
while (yespalin(potentialp))
{
System.out.println("That string is a palindrome");
}
while (!yespalin(potentialp))
System.out.println("That string is not a palindrome, please enter another: ");
potentialp = scan.nextLine();
}
I want the program to repeat if not a palindrome