ジェネリッククラスの定義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 あなたのお住まいの地域で最安のブロードバンド選び コメント: |