Question: Create a method which can perform a particular String operation based on the user's choice. The method should accept the String object and the
Create a method which can perform a particular String operation based on the user's choice. The method should accept the String object and the user's choice and return the output of the operation. Options are A: Add the String to itself B: Replace alternate positions with * C: Remove duplicate characters in the String D: Change alternate characters to upper case Method Name Method Description Argument Return Type Logic changeString Modify the string based on user choice String string, char ch String Perform the required operation based on the user choice and return the resulting string
Step by Step Solution
3.45 Rating (155 Votes )
There are 3 Steps involved in it
import javautil public class Main static String changeStringString string string string string int l... View full answer
Get step-by-step solutions from verified subject matter experts
