源代码:
public class Math { public static void main(String[] args){
int a=1;
int b=2;
int c=(a+b)*10;
}
}
1 用Oolong工具将java字节码翻译为类汇编语言
.source Math.java
.class public super Math
.super java/lang/Object .method public <init> ()V
.limit stack 1
.limit locals 1
.line 1
l0: aload_0
l1: invokespecial java/lang/Object/<init> ()V
l4: return .end method .method public static main ([Ljava/lang/String;)V
.limit stack 2
.limit locals 4
.line 4
l0: iconst_1
l1: istore_1
.line 5
l2: iconst_2
l3: istore_2
.line 6
l4: iload_1
l5: iload_2
l6: iadd
l7: bipush 10
l9: imul
l10: istore_3
.line 7
l11: return .end method
2 java –verbose查看运行类是加载了那些jar文件
3 javap查看字节码