作者Senkousha ( )
看板java
标题[问题] generic type parameter bound?
时间Fri May 1 03:19:14 2009
在 eclipse jdt 的 document 里面看到这个:
http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/dom/TypeParameter.html
http://tinyurl.com/TypeParameter
底下的 typeBounds list ,据我的理解是在 type declaration 里面
宣告 generic type parameter 时可以用的
如:
class Test<SomeType extends TypeBound0 & TypeBound1>
可是後面的注解黄字部份让我觉得很奇怪:
Returns the live ordered list of type bounds of this type parameter.
For the type parameter to be plausible, there can be at most one class
in the list, and it must be first, and the remaining ones must be
interfaces; the list should not contain primitive types
(but array types and parameterized types are allowed).
type bound 可以放 array type 吗? :Q
在什麽情况下可以放呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 164.67.164.220