Java JVM program instruction code example analysis

Time:2020-9-14

This article mainly introduces the Java JVM program instruction code example analysis, this article through the example code introduction is very detailed, has certain reference study value to everybody’s study or the work, needs the friend may refer to

Analysis of Java program transforming into JVM instruction code

1. Write java file (simple example)


/**
 * @author yew
 * @date on 2019/12/9 - 15:53
 */
public class MainTest {

  public static void main(String[] args) {
    int a =1;
    int b=2;
    int c = (a+b)*10;
    System.out.println(c);
  }
}

2. Compile java file to generate XX.class File javac MainTest.java

3. Decompile. Class file as JVM script javap – C – V MainTest.class

The above is the whole content of this article, I hope to help you in your study, and I hope you can support developeppaer more.