Question
JAVA. Ask user for a word and check if it's a palindrome using a Stack data structure . * Your main class ( and only
JAVA. Ask user for a word and check if it's a palindrome using a Stack data structure.
* Your main class (and only class) will include the static method getInputWord, this will prompt the user and return their input as a String. Use Joptionpane.showinputdialog to receive the input.
* Use a second static method named palindromeCheck that will take the String as an input argument and return a Boolean which indicates if the String is a palindrome or not. This method will use a Stack data structure. Use charAt method of the String class for accessing each character of a word.
* Output the result to the screen using JOptionPane.showMessageDialog.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started