title: Quine program without main()
body: <p>I came across this <a href="http://www.reficio.org/2010/01/25/hardcore-java-quine-and-backward-quine/" rel="noreferrer">little quine program</a>, written without main method:</p>
  
  <pre><code>enum f {
    f;
    System z;
    String s="enum f{f;System z;String s=%c%s%1$c;{z.out.printf(s,34,s);z.exit(0);}}";
    {z.out.printf(s,34,s);
    z.exit(0);}
  }
  </code></pre>
  
  <p>Can somebody explain how does this work? Thanks.</p>