fork(17) download
  1. class Base {
  2. static int i;
  3. static{
  4. System.out.println("in static block Base");
  5. }
  6. }
  7.  
  8. class Child extends Base {
  9. static int j;
  10. static{
  11. System.out.println("in static block Child");
  12. }
  13.  
  14.  
  15.  
  16.  
  17. }
  18.  
  19. public class Main{
  20. public static void main(String[] args) {
  21. System.out.println(Child.i);
  22. System.out.println(Base.i);
  23.  
  24. }
  25. }
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
in static block Base
0
0