CJCoding With Joseph
15per day

Return the Middle Item from Three Generic Values

Complete the generic method getMiddle that receives three values of the same type and returns the second one (the middle parameter).

IMPORTANT: Do NOT write a main method. A hidden test will call MiddleTool.getMiddle("A", "B", "C") and MiddleTool.getMiddle(10, 20, 30) and print the middle value from each call.

Expected Output:

B
20
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.