I came across this question :
How can we identify whether a compilation unit is class or interface from a .class file?
The answer given was "from java source file header", with explanation
The Java source file contains a header that declares the type of class or interface, its visibility with respect to other classes, its name and any superclass it may extend, or interface it implements.
But I didn't find anything explaining how source file header dictates class or interface in any standard documentation. Wikipedia says following about the magic number (which I found to be relevant) in the class file:
CAFEBABEbecame the class file format, andCAFEDEADwas the persistent object format.
Can someone point me to document explaining in detail how class file tells whether it's for class or interface along with other details of class file?
.classfile tell whether it corresponds to.javafile containing class or interface.