[SOLVED] Create a class named Palindrome java

10.00 $

Programming resource
, Digital learning resource
Categories: ,
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (2 votes)
Create a class named Palindrome.java then implements the recursive method specified below:

public boolean isPalindrome(String s)

The recursive method: isPalindrome takes a string as a parameter and that returns true if the string is a palindrome and false if it is not. A palindrome is a string like “racecar” that has the same sequence of characters when written forwards and backwards. Notice that in a palindrome, the first and last characters match, as do the second and second-to-last, the third and third-to-last, and so on. However, when we test if a string is a palindrome, we only consider alphabetic letters(a-z and ignore cases) and digits (0-9), we simply ignore all other symbols. The table below includes various method calls and the value returned:

Method Call Result
———————————————————————-
isPalindrome(“radar”) true
isPalindrome(“Was It A Rat I Saw?”) true
isPalindrome(“pe e p”) true
isPalindrome(“x”) true
isPalindrome(“12321”) true
isPalindrome(“Java”) false

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.