GenericExampleのJavaの構文はどのようになっていますか< ItemType(拡張または等しい)オブジェクト>?拡張のための一般的な構文
ありがとう、 Adam。
アップデート:すべてのあなたの返信用
感謝。ここ 答えは、コードでジェネリック医薬品の使用により関連している、私は例えば、減速実装を議論したいと思います:
class GenericExample<ItemType (extends or equal to) ParentType> {
}
class Inherited<ParentType> extends GenericExample<ParentType> {
/* The type parameter in this class does not compile.
I would like to find a work around to make something like this to work.
I would like to have ParentType=JComponent , and thus to specify that the
Inherited class uses JComponent for needed flexibility*/
}
私は、これは、より理にかなって願っています...
アダム。
私は*かなり*それはJavaでは不可能だと確信しています。私が正しく理解していれば、C#で "GenericExample < T >ここでT:SomeParentClass"と宣言したときのようです。 –
@djechelon:それは不可能だと考えるのは間違いでしょう。 =) – ColinD
私は決して1つの文字を使ってパラメータ型を参照することはありません。私は常にマイニングフルの型名を使用します。オブジェクトが何をする必要があるのか、それが何であるかを追跡しやすくします。 – TacB0sS