.class file in Java is core of achieving platform independence which is key feature of Java. class files are compiled form of any Java program written in byte codes. Since Java program executes inside JVM, these instructions are read by JVM and than translated into machine code for underlying platform. effectively you can run class file on any platform if you have a corresponding JVM supported for that platform. Java compilers are responsible for generating .class file and they follow class file format specified by Sun and its different based on different Java version. This article is not a detailed one focused on class file format instead it contains basic information about class files and intended to give an idea about what is a class file in Java and what are some important points related to class files.
This Java article is in continuation of my series of 10 points of interface in Java and 10 Object oriented design principles for Java programmer. If you haven’t got chance to read them you may find them useful.