Question: Check palindrome: Write Java program to check if a string is a palindrome. Write a class which has two method checkPalindrome(String s) {//statement to check
Check palindrome:
Write Java program to check if a string is a palindrome.
Write a class which has two method checkPalindrome(String s) {//statement to check s} main function to test the the checkPalindrome(String s) function. Print the results
Main function:
1)Ask user to enter a string 2) Scan the string 3) Check if the string is a palindrome: call CheckPalindrome() method 4) Print the result
CheckPalindrome method:
1) Create a loop where you will compare the characters of the string
2) Return Boolean: true if the string is a palindrome, false if not
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
