137k views
4 votes
Create a public non-final generic class called Some, which stores a single instance of the parameterized type. Your constructor should take a single instance of the parameterized type and save it. You should also provide getValue and setValue methods that allow the saved value to be retrieved or modified. As usual, your class should not expose any of its state publicly. Note that you may not be able to complete this home

User Gabriel M
by
5.3k points

1 Answer

0 votes

Answer:

See explaination

Step-by-step explanation:

public class Some<T> {

private T value;

public Some(T value) {

this.value = value;

}

public T getValue() {

return value;

}

public void setValue(T value) {

this.value = value;

}

}

User Noveaustack
by
4.7k points