JavaPatternMatching/bin/mycompiler/test/generics/TestClassesWithBoundedGenericsUsedInMethods.jav
2013-10-18 13:33:46 +02:00

21 lines
372 B
Java
Executable File

interface I1 {
public m1();
}
class Implementation implements I1 {
public m1() {
}
}
class TestClassesWithBoundedGenericsUsedInMethods<T extends I1> {
/*since S is at least of Type I1, call m1() should work*/
public <S extends I1> void m3 (S x) {
x.m1();
}
/*T is bounded by class generics, thus always at least of type I1*/
public m2(T x) {
x.m1();
}
}