CJCoding With Joseph
15free / daySign inCreate account

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

= 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.