Question: B. Write a method called genPalin that accepts a String as parameter and returns a palindrome (a string that has characters the same forwards as
B. Write a method called genPalin that accepts a String as parameter and returns a palindrome (a string that has characters the same forwards as it does backwards) version generated from it. It generates it by adding all the letters (except for the last one) of the original string at the end in reverse order. Make sure the returned string has all lower case characters. Examples shown below:
System.out.println(genPalin("1234")); //"1234321" System.out.println(genPalin("Race")); //"racecar" System.out.println(genPalin("pot")); //"potop" System.out.println(genPalin("I")); //"i" Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
