IN JAVA!!!! Write a method named isPalindrome that takes a char array as an argu
ID: 3732803 • Letter: I
Question
IN JAVA!!!!
Write a method named isPalindrome that takes a char array as an argument and returns true if it represents a palindrome and false otherwise. Print this value in your main.
Test this method in your main three times with different char arrays. At least one test should return true and at least one should return false. Do not include spaces in your input.
Palindromes read the same forwards and backwards.
Example
Input: [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
Return: false
Input: [‘k’, ‘a’, ‘y’, ‘a’, ‘k’]
Return: true
Explanation / Answer
Please find the program below. Proper description and explanation is provided in the class/methods java doc section.
OUTPUT of the program execution with 4 test cases are provided as well.
OUTPUT :
========
{'h','e','l','l','o'} = false
{'k','a','y','a','k'} = true
{'m','a','d','a','m'} = true
{} = false