Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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'

Java
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions