我一直在阅读上泛型最近,我碰到这个方法来:爪哇 - 泛型方法
protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> callable, RunnableScheduledFuture<V> task) {
return new ExceptionHandlingFutureTask<V>(callable, task);
}
你看,我明白了为什么有protected
后<V>
。我不明白的是为什么有RunnableScheduledFuture
后再次<V>
。我把这个特殊的<V>
从方法中解释出来,编译出来,没有错误。那么为什么作者决定把它放在那里呢?
Aaaaaaah,我明白了!非常感谢。现在有很多意义:) – 2012-03-29 08:59:40