CJCoding With Joseph
15per day

Copy a Generic Value into a Box

Complete the generic method copyIntoBox in the BoxTools class. It receives a Box<T> and a value of type T, and should store that value in the box using its setItem method.

The full Box class and the method signature are already provided.

IMPORTANT: Do NOT write a main method. A hidden test will create String and Integer boxes, call copyIntoBox to update them, then print the new stored values using getItem().

Expected Output:

new value
50
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.