Pair<F, S>
is a custom generic class as defined below:
class Pair<F, S> {
Pair(F f, S s) {
first = f;
second = s;
}
F getFirst() { return first; }
S getSecond() { return second; }
F first;
S second;
}
We have some statements below that instantiate Pair<F, S>
:
A.
Pair<String,Integer> p = new Pair<String,Integer>("N", 100);
B.
Pair<?,Number> p = new Pair<String, Integer>("N", 100);
C.
Pair<String,Number> p = new Pair<>("N", 100);
D.
Pair<?,?> p = new Pair<String,Integer>("N", 100);
E.
Pair<String,?> p = new Pair<>("N", 100);
Select all the valid statements from above that instantiate Pair. Valid here means that compiles successfully.