forward or backward. "Here are two sample runs: *Enter a string: abcdcba The input string is a palindrome. * Enter a str
Posted: Tue Jul 12, 2022 8:16 am
forward or backward. "Here are two sample runs: *Enter a string: abcdcba The input string is a palindrome. * Enter a string: abcdefg The input string is not a palindrome. import java.util.Scanner; public class PalindromeStack (. public static void main(String args) { System.out.print("Enter a string: "); Scanner input = new Scanner(System.in); Strings input.next(); // input string String (= "; // reverse string ArrayStack stack=new ArrayStack(); ADD YOUR CODE HERE else if (s.equals(t)) System.out.printini The input string is a palindrome."); 4 System.out.println("The input string is not a palindrome."); // end main // end PalindromeStack