Why does this compile?
B is used in A without any generic parameters, and this compiled in Java. What is going on here?
interface B<T>
{
public T Foo(T value);
}
public class A
{
public B What()
{
return null;
}
public void Foo()
{
B x = What();
x.Foo(123);
}
}
This is for compatibility with pre-J2SE 5.0 Java. You should get a rawtypes warning (take notice of the compiler warnings).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With