Header Ads

  • Breaking Now

    What is Java class file's magic number?

    A Magic Number of a class file is a unique identifier for tools to quickly differentiate class files from non class files.The first four bytes of each Java class file has the magic value as 0xCAFEBABE.And the answer to why this number,I do not actually know but there may be very few sensible and acceptable options possible constructed from letters A-F which can surely not be 'CAFEFACE' or 'FADECAFE'....

    6 comments:

    1. This value is a inside joke by the creators of java. It alludes to a statement like "Caffeine baby" refers to caffeine and coffee, hence the name of the language "Java" and the coffee reference.

      ReplyDelete
    2. Correct...an anecdote quite popular in Java world..

      ReplyDelete
    3. Terrific work! This is the type of information that should be shared around the web. Shame on the search engines for not positioning this post higher!

      ReplyDelete
    4. The wiki entry about Java class files contains the historical episode about 0xCAFEBABE: http://en.wikipedia.org/wiki/Java_class_file

      ReplyDelete
    5. really good ans...

      ReplyDelete

    Post Top Ad

    Post Bottom Ad