Question: Create a method changeString with two string parameters wordA and wordB. Method should swap the first two characters in these strings wordA and wordB and
Create a method changeString with two string parameters wordA and wordB. Method should swap the first two characters in these strings wordA and wordB and output the results.
Example of method call: changeString(banana,apple);
Output should be apnana, baple
Example of method call: changeString(memo,review);
Output should be remo, meview
In the main method ask the user for two words with 3 or more letters(Ask the user again if the word has less than 3 letters) and then call the method changeString with these words as parameters.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
