← Back to Generics
Question 177
Write a Generic Method to Print Two Items
Write a Generic Method to Print Two Items
Complete the generic static methodprintTwoItemsthat takes two values of the same type and prints each one on its own line. IMPORTANT: Do NOT write a main method. A hidden test will callPrinter.printTwoItems('A', 'B')andPrinter.printTwoItems(5, 10)and verify each value prints on its own line.
Expected Output:
A B 5 10
= newline. The output ends with a newline — 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.