11
|
1 package treecms.test;
|
|
2
|
|
3 import java.util.ArrayList;
|
|
4 import java.util.List;
|
|
5
|
|
6 public class GenericsTest<E extends Foo>
|
|
7 {
|
|
8 public static void main(String _args[])
|
|
9 {
|
|
10 GenericsTest<Hoge> h = new GenericsTest<Hoge>(null);
|
|
11 }
|
|
12
|
|
13 public GenericsTest(E _instance)
|
|
14 {
|
|
15 E kasu = (E)_instance.get();
|
|
16 }
|
|
17 }
|
|
18
|
|
19 interface Foo
|
|
20 {
|
|
21 public Foo get();
|
|
22 public List<Foo> list();
|
|
23 }
|
|
24
|
|
25 interface Hoge extends Foo
|
|
26 {
|
|
27 @Override
|
|
28 public Hoge get();
|
|
29
|
|
30 @Override
|
|
31 public List<Foo> list();
|
|
32 } |