java 6 is free from boxing problem in covariant position

This commit is contained in:
anna
2012-11-16 12:23:24 +01:00
parent 92f31cfd65
commit ec89f9e0a9
3 changed files with 18 additions and 1 deletions
@@ -0,0 +1,16 @@
import java.util.*;
class Test {
static class Pair<A, B> {
Pair(A a, B b) {
}
static <A, B> Pair<A, B> create(A a, B b) {
return new Pair<A, B>(a, b);
}
}
public static void getWordsWithOffset(String s, int startInd, final List<Pair<String, Integer>> res) {
res.add(Pair.create(s, startInd));
}
}