โ Back to Methods
Question 187
Create a Generic Method to Print an Array
Create a Generic Method to Print an Array
Complete the generic methodprintArraythat 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 callArrayPrinter.printArraywith 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
Topics:
GenericsMethods
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.