Skip to content

Instantly share code, notes, and snippets.

@LCamel
Created March 8, 2011 08:37
Show Gist options
  • Select an option

  • Save LCamel/860036 to your computer and use it in GitHub Desktop.

Select an option

Save LCamel/860036 to your computer and use it in GitHub Desktop.
Java init
public class Foo {
private int i = 3;
{
System.out.println("{}1: i: " + i);
i = 4;
}
public Foo() {
System.out.println("Foo(): " + i);
i = 5;
}
{
System.out.println("{}2: i: " + i);
i = 6;
}
public static void main(String[] args) {
new Foo();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment