自我界定的泛型 [英] Self bounded generics
本文介绍了自我界定的泛型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这些泛型之间是否有实际的区别
public class SelfBounded< T extends SelfBounded< T>> {}
和这一个
public class SelfBounded< T extends SelfBounded> {}
?
如果是,那我该如何观察它们?
解决方案
这里已经有很多类似的问题。
您可以阅读以下文章
或者下列问题:
Is there is any actual difference between these this generic
public class SelfBounded <T extends SelfBounded<T>>{}
and this one
public class SelfBounded <T extends SelfBounded>{}
?
If yes, then how can I observe them?
解决方案
There are a lot of similar questions here already. You can read the following article
Or the following questions:
- Java Enum definition
- Why in java enum is declared as Enum<E extends Enum<E>>
- What would be different in Java if Enum declaration didn't have the recursive part
这篇关于自我界定的泛型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文