为什么我在接口上使用以下定义在eclipse上获得编译错误:
Area是一个接口.
public interface Shape {
...
public Comparator<T extends Area> getComparator();
}
Run Code Online (Sandbox Code Playgroud)
而不是如果我改为使用:
public interface Shape {
...
public Comparator<? extends Area> getComparator();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
49 次 |
| 最近记录: |