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 InnnerClass8 <T > {
7+
8+ <T extends List <? super Number >>T test (T t ){
9+ int num = 23 ;
10+ class MethodInner <V extends Set <? super Number >> {
11+ public void print () {
12+ System .out .println ("This is method inner class " + num );
13+ }
14+ }
15+
16+ MethodInner <HashSet <Number >> inner = new MethodInner <HashSet <Number >>();
17+ inner .print ();
18+
19+ return t ;
20+ }
21+
22+ public static void main (String [] args ) {
23+ InnnerClass8 <String > outer = new InnnerClass8 <String >();
24+
25+ ArrayList <Number > list = new ArrayList <>();
26+ list .add (1 );
27+ list .add (2 );
28+ list .add (3 );
29+ list .add (4 );
30+ list .add (5 );
31+
32+ System .out .println (outer .test (list ));
33+
34+ }
35+
36+
37+
38+ }
You can’t perform that action at this time.
0 commit comments