Question: Array Programming Write a static method named joiner that accepts two arrays of strings al and a2 as parameters and returns a new array a3

Array Programming Write a static method named joiner that accepts two arrays of strings al and a2 as parameters and returns a new array a3 such that each element of a3 at each index i stores a new string composed of the words stored at al[] and a2[i] joined together with the word with the work having greater length (more characters) at the front of the concatenated string. If there is a tie, take the element from al. For example, if al and a2 store the following elements: String[] a1= {"star", "pie", "jelly bean", "car"); String a2"cookie", "tig", "banana", "soda") Then your method should return the new array: "cookiestar", "piefig", "jelly beanbanana", "sodacar" If the arrays al and a2 are not the same length, the result returned by your method should have as many elements as the shorter of the two arrays. For example, if al and a2 store the following elements: String [ ] a1= {"Splinter", "Leo", "April", "Don", "Raph"); Stringt a2 "Krang", "Shredder", "Bebop": Then your method should return the new array ("SplinterKrang", " For full credit, do not modify the elements of al or a2. Do not make any assumptions about the length of al or a2 or the length of the strings. You may assume that neither array is null and that no element of either array is null ShredderLeo", "AprilBebop")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
