File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import java .util .ArrayList ;
2+ import java .util .HashSet ;
3+ import java .util .List ;
4+ import java .util .Set ;
5+
6+ public class InnnerClass7 <T > {
7+
8+ <T extends ArrayList <String > & List <String >> T test (T t ){
9+ int num = 23 ;
10+ class MethodInner <V extends HashSet <String > & Set <String >> {
11+ public void print () {
12+ System .out .println ("This is method inner class " + num );
13+ }
14+ }
15+
16+ MethodInner <HashSet <String >> inner = new MethodInner <HashSet <String >>();
17+ inner .print ();
18+
19+ return t ;
20+ }
21+
22+ public static void main (String [] args ) {
23+ InnnerClass7 <String > outer = new InnnerClass7 <String >();
24+
25+ ArrayList <String > list = new ArrayList <>();
26+ list .add ("one" );
27+ list .add ("two" );
28+ list .add ("three" );
29+ list .add ("four" );
30+ list .add ("five" );
31+
32+ System .out .println (outer .test (list ));
33+
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments