Task 2 of 7 · 0 solved · 7 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

9.1 Generic classes — write a generic Holder

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Write the generic class Holder<T>. It stores one value of type T, set by the constructor, with getValue() returning it and setValue(T value) replacing it.

Use the type parameter T, not Object — main builds a Holder of Strings and one of Integers from the same class.

Your solution