The magic number at the start of all Java class files.

Every Java program compiled into bytecode must start with the hex (base 16) bytes CA, FE, BA, and BE to help identify it as a valid class file.

For those users that somehow need to know the value in decimal, but don't know hexadecimal*, here it is: 202, 254, 186, and 190.
* being too lazy to convert does not count as being a luser :)

This from Patrick Naughton, one of the original members of the team that eventually produced Java:

Strangely enough the magic number for .class files was chosen long before the name Java was ever uttered in reference to this language. We were looking for something fun, unique and easy to remember. 0xcafebabe was better than the second runner-up, 0xdeadbabe. :-)

It is only a coincidence that the oblique reference to the cute baristas at Peet's Coffee was foreshadowing for the name Java.

Log in or register to write something here or to contact authors.