@jlacar/

RanchBeTheCompiler

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Main {
  public static void main(String[] args) {
    StaticTests.main(args);
  }
}

class StaticSuper {
  static {
    System.out.println("super static block");
  }
 
  StaticSuper() {
    System.out.println("super constructor");
  }
}

class StaticTests extends StaticSuper {
  static int rand;

  static {
    rand = (int) (Math.random() * 6);
    System.out.println("static block " + rand);
  }
 
  StaticTests() {
    System.out.println("constructor");
  }
 
  public static void main(String[] args) {
    System.out.println("in main");
    StaticTests st = new StaticTests();
  }
}