0 引言
1 JDK命令: javac
反编译指定类: javac -c {className}
参考命令 :
C:\Users\xxxxxx> javap -c java.lang.Object > "Object.txt"
C:\Users\xxxxxx> javap -c java.lang.Object
Compiled from "Object.java"
public class java.lang.Object {
public java.lang.Object();
Code:
0: return
public final native java.lang.Class<?> getClass();
public native int hashCode();
public boolean equals(java.lang.Object);
Code:
0: aload_0
1: aload_1
2: if_acmpne 9
5: iconst_1
6: goto 10
9: iconst_0
10: ireturn
protected native java.lang.Object clone() throws java.lang.CloneNotSupportedException;
public java.lang.String toString();
Code:
0: new #52 // class java/lang/StringBuilder
3: dup
4: invokespecial #74 // Method java/lang/StringBuilder."<init>":()V
7: aload_0
8: invokevirtual #73 // Method getClass:()Ljava/lang/Class;
11: invokevirtual #67 // Method java/lang/Class.getName:()Ljava/lang/String;
14: invokevirtual #76 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
17: ldc #2 // String @
19: invokevirtual #76 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
22: aload_0
23: invokevirtual #70 // Method hashCode:()I
26: invokestatic #69 // Method java/lang/Integer.toHexString:(I)Ljava/lang/String;
29: invokevirtual #76 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
32: invokevirtual #75 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
35: areturn
public final native void notify();
public final native void notifyAll();
public final native void wait(long) throws java.lang.InterruptedException;
public final void wait(long, int) throws java.lang.InterruptedException;
Code:
0: lload_1
1: lconst_0
2: lcmp
3: ifge 16
6: new #48 // class java/lang/IllegalArgumentException
9: dup
10: ldc #4 // String timeout value is negative
12: invokespecial #68 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
15: athrow
16: iload_3
17: iflt 26
20: iload_3
21: ldc #1 // int 999999
23: if_icmple 36
26: new #48 // class java/lang/IllegalArgumentException
29: dup
30: ldc #3 // String nanosecond timeout value out of range
32: invokespecial #68 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
35: athrow
36: iload_3
37: ifle 44
40: lload_1
41: lconst_1
42: ladd
43: lstore_1
44: aload_0
45: lload_1
46: invokevirtual #72 // Method wait:(J)V
49: return
public final void wait() throws java.lang.InterruptedException;
Code:
0: aload_0
1: lconst_0
2: invokevirtual #72 // Method wait:(J)V
5: return
protected void finalize() throws java.lang.Throwable;
Code:
0: return
static {};
Code:
0: invokestatic #71 // Method registerNatives:()V
3: return
}
X 参考文献
标签:lang,Ljava,java,String,javac,public,诊断,JVM,Method From: https://www.cnblogs.com/johnnyzen/p/18429993
javap
/jad