VB.NET

ジェネリッククラスの定義C#版

Class MyGenericClass1(Of t As Structure)
    ' 制約:Tは構造体
End Class
Class MyGenericClass2(Of T As Class)
    '制約:Tはクラス
End Class
Class MyGenericClass3(Of T As New)
    '制約:Tはインスタンス化可能
End Class
Class MyGenericClass4(Of T As OtherClass)
    '制約:TはOtherClassクラスを継承
End Class
Class MyGenericClass5(Of T As IMyInterface)
    '制約:TはIMyInterfaceインターフェイスを実装
End Class
Class MyGenericClass6(Of U, T As U)
    '制約:Tは別の型パラメータUを継承
End Class
Class MyGenericClass7(Of T As {OtherClass(Of T), IDisposable, New}, F As Class)
    Implements IDisposable
    '制約:T,Fは別々のクラス
End Class
Class thisClass(Of t As {IComparable, IDisposable, Class, New})

End Class
Class OtherClass
    'あるクラス
End Class
Class OtherClass(Of T)
    'あるクラス
End Class
Interface IMyInterface
    'あるインターフェイス
End Interface


あなたのお住まいの地域で最安のブロードバンド選び

コメント:



(画像の文字列を入力して下さい)

トップ   編集 凍結 差分 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2019/12/02 (月) 12:43:02 (1627d)

e[NȂECir Yahoo yV LINEf[^[Ōz500~`I
z[y[W ̃NWbgJ[h COiq@COsیI COze