Fun Java Fact
Here’s a fun but useless (to most everyone but a few) Java fact. I found this while digging through some config files when I was setting up this new server. I don’t remember which one it was. But here it is.
The magic number for a Java .class file is CAFE. A magic number is the first two bytes in a binary executable file which are used to tell what type of file it is since the file extension is something that can change. Most often, the two byte magic number is written in hexadecimal. For Java, that happens to be 0xCA and 0xFE. Coffee, Cafe. A little joke that the developers of the Java Language Specification must have enjoyed. I looked at a couple of class files with a hex editor, XVI, and sure enought it’s true.
Explore posts in the same categories: Tech
