[問題] generic type parameter bound?
在 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
討論串 (同標題文章)
以下文章回應了本文 (最舊先):
完整討論串 (本文為第 1 之 8 篇):