Skip to content

Instantly share code, notes, and snippets.

@eckucukoglu
Created February 14, 2018 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eckucukoglu/e1b81bc1242bda2f83f6f906e01333e6 to your computer and use it in GitHub Desktop.
Save eckucukoglu/e1b81bc1242bda2f83f6f906e01333e6 to your computer and use it in GitHub Desktop.
class A {
static final String name = "A";
static final B b = new B();
A () {
System.out.println(name + " is loading...");
}
}
class B {
static final String name = "B";
static final C c = new C();
B () {
System.out.println(name + " is loading...");
}
}
class C {
static final String name = "C";
static final A a = new A();
C () {
System.out.println(name + " is loading...");
}
}
public class Main {
public static void main(String[] args) {
A a = new A();
System.out.println("-----");
B b = new B();
System.out.println("-----");
C c = new C();
}
}
@eckucukoglu
Copy link
Author

eckucukoglu commented Feb 14, 2018

A is loading...
C is loading...
B is loading...
A is loading...
/----
B is loading...
/----
C is loading...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment