title: Why do we need a magic number in the beginning of the .class file?
body: <p>I read a few posts here about the magic number <code>0xCAFEBABE</code> in the beginning of each java <strong>.class</strong> file and wanted to know <strong>why</strong> it is needed - what is the purpose of this marking?<br>
  Is it still needed anymore? or is it just for backwards compatibility now? </p>
  
  <p>Couldn't find a post that answers this - nor did I see the answer in the java <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html" rel="noreferrer">spec</a></p>