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
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