-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLowerBoundWildCard2.java
37 lines (26 loc) · 1.05 KB
/
LowerBoundWildCard2.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.AbstractSet;
import java.util.NavigableSet;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
interface D {
}
public class LowerBoundWildCard2<T extends Set<? super TreeSet<D>>> {
public void add(int a, int b) {
System.out.println(a + b);
}
public static void main(String[] args) {
LowerBoundWildCard2<TreeSet<TreeSet<D>>> obj = new LowerBoundWildCard2<>();
LowerBoundWildCard2<TreeSet<Object>> obj1 = new LowerBoundWildCard2<>();
LowerBoundWildCard2<TreeSet<Set<D>>> obj2 = new LowerBoundWildCard2<>();
LowerBoundWildCard2<TreeSet<AbstractSet<D>>> obj3 = new LowerBoundWildCard2<>();
LowerBoundWildCard2<TreeSet<NavigableSet<D>>> obj4 = new LowerBoundWildCard2<>();
LowerBoundWildCard2<TreeSet<SortedSet<D>>> obj5 = new LowerBoundWildCard2<>();
obj.add(10, 20);
obj1.add(10, 20);
obj2.add(10, 20);
obj3.add(10, 20);
obj4.add(10, 20);
obj5.add(10, 20);
}
}