Java application usually required a main() method as entry point to run it. Here’s an example by using static initializer to run a Java application even without the main() method.

P.S The static initializer is called while the Java class is loaded.
This is for fun only, do not use this example in real environment as a replacement for main() method, static initializer is not created for the Java main() application entry point purpose :)
public class App{
        System.out.println("Magic here ~");
Run the above Java application, it will print out the “Magic here ~” to console.