Question: Java 3. Write a function to reverse a string: public static String reverse(String s) Hint: given a string s, s-'a'+s; will add the character 'a'
3. Write a function to reverse a string: public static String reverse(String s) Hint: given a string s, s-'a'+s; will add the character 'a' to the front of the string. When writing these functions, do not print inside the function except for debugging. Return the string to be constructed and print where it's called. 3b. A "palindrome" is a string that reads the same forwards and backwards. For example, "noon" and "bob" aree function that determines if a string is a if it's a palindrome and false palindromes. Write a boolean palindrome (returns true otherwise): public static boolean palindrome(String s)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
