โ Back to Methods
Question 186
Copy a Generic Value into a Box
Copy a Generic Value into a Box
Complete the generic methodcopyIntoBoxin theBoxToolsclass. It receives aBox<T>and a value of typeT, and should store that value in the box using itssetItemmethod. The fullBoxclass and the method signature are already provided. IMPORTANT: Do NOT write a main method. A hidden test will create String and Integer boxes, callcopyIntoBoxto update them, then print the new stored values usinggetItem().
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.