1. java代码:
public class Test{
public static void main(String[] args){
Integer i = 10; //装箱
int n = i; //拆箱
}
}
2. 编译
javac 编译
3.查看字节码
javap -c D:\ls\Test.class > D:\ls\MyClassBytecode.txt
4. 部分解析
bipush byteInteger push压入栈顶
invokestatic #2 启动静态方法 #2是方法的符号引用
5:astore_1 a指的是引用类型,store保存到本地变量表,1是位置. 5指令在方法的字节码中的偏移位置
aload_1 本地变量表1的位置加载到栈