“…the JVM doesn’t just load the byte codes and run them. Instead, the virtual machine must verify the byte codes with something called a byte code verifier.
…
In addition, the verifier ensures the first four bytes of the file are 0xCAFEBABE.”
Truth or a joke?
:o
Truth, open .class file with hexeditor
Hah, I DID know that. =D
And if you’ve read the jvms, so should you.
Where’s the news?
Pretty old news to some of us, sorry.
CAFEBABE is the “magic number” the Vm uses as a first quick check that what you are loading is a class file.
Ok ok - I admit I am a newbie.
:-[
[quote]"(…)In addition, the verifier ensures the first four bytes of the file are 0xCAFEBABE."
[/quote]
Nice.
Remembers me to the good old days on the homecomputers where we “signed” our small assembler routines with similar stuff: 0xDEADBEEF comes to mind.
Good old days? People still use things like 0xDEADBEEF. Those who don’t know about Java, anyway…
Well its more appealing than all those obscure debugging codes like 0xCCCCCCCC or 0xCDCDCDCD you get with VS C++