โ Back to Methods
Question 189
Return the Middle Item from Three Generic Values
Return the Middle Item from Three Generic Values
Complete the generic methodgetMiddlethat 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 callMiddleTool.getMiddle("A", "B", "C")andMiddleTool.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.