1 public class AssertInInner1 { 2 3 public static void main(String [] args){ 4 5 } 6 7 class InnerNonStaticInit { 8 void run() { 9 int x = 0; 10 assert x > 1 : "NONSTATIC throwing assert during class init"; 11 } 12 class InnerDeepNonStaticInit { 13 void run(){ 14 int x = 0; 15 assert x > 1 : "DEEP throwing assert"; 16 } 17 } 18 } 19 20 static class InnerStaticInit { 21 static { 22 int x = 0; 23 assert x > 1 : "STATIC throwing assert during class init"; 24 } 25 } 26 27 } 28 | Popular Tags |