2017-03-22 15:05:59 +00:00
|
|
|
|
|
|
|
class Generics<B> {
|
2017-09-20 21:41:06 +00:00
|
|
|
<A extends B> A mt1(A a, B b){
|
2017-03-22 15:05:59 +00:00
|
|
|
return mt1(a, a);
|
|
|
|
}
|
|
|
|
}
|
2017-04-18 19:06:04 +00:00
|
|
|
|
|
|
|
class Test {
|
|
|
|
methode(String s){
|
|
|
|
return new Generics<String>().mt1(s,s);
|
|
|
|
}
|
|
|
|
}
|
2017-09-22 16:31:47 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Problem:
|
|
|
|
auto test = new List<String>();
|
|
|
|
auto test2 = new List<Integer>();
|
|
|
|
... //code, welcher möglicherweise test und test2 vertauscht
|
|
|
|
test.add("hallo");
|
|
|
|
*/
|