CJCoding With Joseph
15free / daySign inCreate account

Make a Generic Wrapper Class

Complete the Wrapper<T> class. The field is already declared. Add a constructor that stores the value, and complete the showValue() method so it prints the stored item.

IMPORTANT: Do NOT write a main method. A hidden test will create a Wrapper<String> with "Hello" and a Wrapper<Double> with 8.5, then call showValue() on each.

Expected Output:

Hello
8.5

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

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