ジェネリクスで複数のインターフェイスを指定
って出来たんですね。知らなかった・・・
interface I1 {} interface I2 {} // こんな感じ class C1 <E extends I1 & I2> {} class C2 {} // クラスを指定する場合はextendsの直後に指定する class C3 <E extends C2 & I1 & I2> {}
Java Language Specification Third Edition - Type Variables
- TypeParameter:
- TypeVariable TypeBoundopt
- TypeBound:
- extends ClassOrInterfaceType AdditionalBoundListopt
- AdditionalBoundList:
- AdditionalBound AdditionalBoundList
AdditionalBound- AdditionalBound:
- & InterfaceType
それとmainメソッド。
Finally, after completion of the initialization for class Test (during which other consequential loading, linking, and initializing may have occurred), the method main of Test is invoked.
The method main must be declared public, static, and void. It must accept a single argument that is an array of strings. This method can be declared as eitherpublic static void main(String[] args)or
public static void main(String... args)Java Language Specification Third Edition - Invoke Test.main
下もOKだったのか。やばい、知らないことだらけ。