Mercurial > hg > Members > shoshi > TreeCMSv2
comparison src/treecms/test/GenericsTest.java @ 11:85061e874775
commit
author | shoshi |
---|---|
date | Fri, 06 May 2011 00:42:57 +0900 |
parents | |
children | 8bf59f161b23 |
comparison
equal
deleted
inserted
replaced
10:4e0ed81bea89 | 11:85061e874775 |
---|---|
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 } |