Skip to content

Instantly share code, notes, and snippets.

@shalecraig
Created April 19, 2013 16:31
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 shalecraig/5421482 to your computer and use it in GitHub Desktop.
Save shalecraig/5421482 to your computer and use it in GitHub Desktop.
Take a guess at what this does...
public class Test {
public static void main(String[] args) {
System.out.println("One");
}
static {
System.out.println("Two");
}
{
System.out.println("Three");
}
}
@n00shie
Copy link

n00shie commented Apr 19, 2013

I would guess it prints "Two" out first, then "One" then "Three"

@bastarma
Copy link

"Two" then "One" and that's it?

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