CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Instantiating a Generic Class

Java quiz · Question 28
easyGenerics, Classes

Given the generic class below, which line correctly creates a Box that holds a String?

Code

1class Box<T> {
2 private T value;
3 public Box(T value) { this.value = value; }
4 public T getValue() { return value; }
5}