CJCoding With Joseph
15free / daySign inCreate account

Write a Generic Printer Method

Complete the generic static method printItem inside the Printer class. It takes one parameter of any type and prints it to the console.

IMPORTANT: Do NOT write a main method. A hidden test will call Printer.printItem("Java"), Printer.printItem(25), and Printer.printItem(2.5) and verify each value prints on its own line.

Expected Output:

Java
25
2.5

= newline. The output ends with a newline — print one after the last line.

Hints2 available
Topics:
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.