2009-03-29から1日間の記事一覧

キャストしないでサプタイプの型に変換する

ジェネリクスねた。 Java Generics and Collections: Speed Up the Java Development Process の9.4 Strategy に出てくる話です。 @Test public void test() throws Exception { Aaa<Bbb> hoge = new Bbb(); Bbb bbb = hoge.asSubtype(); Aaa<Ccc> foo = new Ccc(); Cc</ccc></bbb>…