Create a Generic Method to Print an Array
mediumQuestion 187Complete the generic method printArray that takes an array of any type and prints each element on its own line.
IMPORTANT: Do NOT write a main method. A hidden test will call ArrayPrinter.printArray with the String array {"one", "two"} and the Integer array {1, 2} and verify each element is printed on its own line.
Expected output
one two 1 2
= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
GenericsMethods
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.