Static fields have class-level scope, so they can execute even without a main() method. Here's an example:
public class Static { static{System.out.println("I will print without main()");} }