package jls8;

/**
 * Example 12.4.1-3.
 * Interface Initialization Does Not Initialize Superinterfaces
 */
public class Eg12_4_1_3 {
    
    private static interface I {
        int i = 1, ii = Test.out("ii", 2);
    }
    private static interface J extends I {
        int j = Test.out("j", 3), jj = Test.out("jj", 4);
    }
    private static interface K extends J {
        int k = Test.out("k", 5);
    }
    private static class Test {
        static int out(String s, int i) {
            System.out.println(s + "=" + i);
            return i;
        }
    }
    
    public static void main(String[] args) {
        System.out.println(J.i);
        System.out.println(K.j);
    }
    
}

@@ -189,21 +189,16 @@
 1, ii = 
-Test.
 out(%22ii%22
@@ -264,29 +264,24 @@
     int j = 
-Test.
 out(%22j%22, 3),
@@ -286,21 +286,16 @@
 ), jj = 
-Test.
 out(%22jj%22
@@ -369,13 +369,8 @@
 k = 
-Test.
 out(
@@ -388,44 +388,8 @@
   %7D%0A
-    private static class Test %7B%0A    
     
@@ -426,28 +426,24 @@
 ) %7B%0A        
- 
-   
 System.out.p
@@ -471,20 +471,16 @@
         
-    
 return i
@@ -485,18 +485,8 @@
  i;%0A
-        %7D%0A
     

simplify code