| 1 | class Box<T> { |
| 2 | private T value; |
| 3 | |
| 4 | void set(T value) { |
| 5 | this.value = value; |
| 6 | } |
| 7 | |
| 8 | T get() { |
| 9 | return value; |
| 10 | } |
| 11 | |
| 12 | public static void main(String[] args) { |
| 13 | Box<Integer> scoreBox = new Box<>(); |
| 14 | scoreBox.set(88); |
| 15 | |
| 16 | Box<String> labelBox = new Box<>(); |
| 17 | labelBox.set("Top score"); |
| 18 | |
| 19 | System.out.println(labelBox.get() + ": " + scoreBox.get()); |
| 20 | } |
| 21 | } |
nothing calls this directly
no outgoing calls
no test coverage detected