public static void bar(Foo<Integer> f){}
public static class Foo<T>{
Foo<T> self(){
return this;
}
}
public static void main(String[] args) {
bar(new Foo<>().self()); //gives an error, because new Foo<>().self() returns Foo<Object>
}
public static void bar(Foo<Integer> f){}
public static class Foo<T>{
Foo<T> self(){
return this;
}
}
public static void main(String[] args) {
bar(new Foo<>().self()); //gives an error, because new Foo<>().self() returns Foo<Object>
}