Question: java 1 Write a static method that is passed in 2 Strings and return another String made up of the alternating characters from each argument.

java 1

java 1 Write a static method that is passed in 2 Strings

Write a static method that is passed in 2 Strings and return another String made up of the alternating characters from each argument. If one argument is longer than the other, then its characters are tacked on to the end of the return String. Here are some sample calls and their return values: method("abc", "123") returns "a1b2c3" method("xy", "$%&") returns "x$y%&" Notice the leftover characters method("abcd" , "12") returns "a1b2cd" Hint! In this code you may use only one for loop and if statement. No nested loops

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!