

Step 2: Now check with another version which may be higher or lower than already installed. Step 1: Open a command prompt window and try to check java compiler version and JVM version using following commands respectively (Highlighted text in image are the commands) This demonstration is for Windows OS as follows: If we will try to execute we will get run time exception. class file cannot be executed by lower version JVM. class file can be executed by high version JVM but higher version compiler generated. We denotes the version of class file as M.m where M stands for major_version and m stands for minor_version JVM will use these versions to identify which version of the compiler generates the current. minor_version & major_version: These both together represents.Note: This can vary depending on how much you remove the. you will get run time exception ( See the highlighted text in below image): Step 4: Now try to run this using java Sample command and see the magic i.e.

Step 3: Now erase at least single symbol from this Sample.class file from starting of file and save it. java file named as Sample.java as follows and follow step by step process on your system. Now let’s see what happen when JVM will not find valid magic number. The predefined value will be in hexadecimal form i.e. class file is generated by valid compiler or not. This is a predefined value which the JVM use to identify whether the. magic_number: The first 4 bytes of class file are termed as magic_number.ISRO CS Syllabus for Scientist/Engineer ExamĪ single class file structure contains attributes that describe a class file.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.
