public class equaltest {
public static void main(String[] args) {
Object o1 = new Object();
Object o2 = new Object();
if (o1 == o2) {
System.out.println("o1 == o2");
} else {
System.out.println("o1 != o2");
}
}
}
Compiled from "equaltest.java"
public class equaltest extends java.lang.Object
SourceFile: "equaltest.java"
minor version: 0
major version: 50
Constant pool:
const #1 = Method#2.#18;// java/lang/Object."<init>":()V
const #2 = class#19;// java/lang/Object
const #3 = Field#20.#21;// java/lang/System.out:Ljava/io/PrintStream;
const #4 = String#22;// o1 == o2
const #5 = Method#23.#24;// java/io/PrintStream.println:(Ljava/lang/String;)V
const #6 = String#25;// o1 != o2
const #7 = class#26;// equaltest
const #8 = Asciz<init>;
const #9 = Asciz()V;
const #10 = AscizCode;
const #11 = AscizLineNumberTable;
const #12 = Ascizmain;
const #13 = Asciz([Ljava/lang/String;)V;
const #14 = AscizStackMapTable;
const #15 = class#19;// java/lang/Object
const #16 = AscizSourceFile;
const #17 = Ascizequaltest.java;
const #18 = NameAndType#8:#9;// "<init>":()V
const #19 = Ascizjava/lang/Object;
const #20 = class#27;// java/lang/System
const #21 = NameAndType#28:#29;// out:Ljava/io/PrintStream;
const #22 = Ascizo1 == o2;
const #23 = class#30;// java/io/PrintStream
const #24 = NameAndType#31:#32;// println:(Ljava/lang/String;)V
const #25 = Ascizo1 != o2;
const #26 = Ascizequaltest;
const #27 = Ascizjava/lang/System;
const #28 = Ascizout;
const #29 = AscizLjava/io/PrintStream;;
const #30 = Ascizjava/io/PrintStream;
const #31 = Ascizprintln;
const #32 = Asciz(Ljava/lang/String;)V;
{
public equaltest();
Signature: ()V
Code:
Stack=1, Locals=1, Args_size=1
0:aload_0
1:invokespecial#1; //Method java/lang/Object."<init>":()V
4:return
LineNumberTable:
line 1: 0
public static void main(java.lang.String[]);
Signature: ([Ljava/lang/String;)V
Code:
Stack=2, Locals=3, Args_size=1
0:new#2; //class java/lang/Object
3:dup
4:invokespecial#1; //Method java/lang/Object."<init>":()V
7:astore_1
8:new#2; //class java/lang/Object
11:dup
12:invokespecial#1; //Method java/lang/Object."<init>":()V
15:astore_2
16:aload_1
17:aload_2
18:if_acmpne32
21:getstatic#3; //Field java/lang/System.out:Ljava/io/PrintStream;
24:ldc#4; //String o1 == o2
26:invokevirtual#5; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
29:goto40
32:getstatic#3; //Field java/lang/System.out:Ljava/io/PrintStream;
35:ldc#6; //String o1 != o2
37:invokevirtual#5; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
40:return
LineNumberTable:
line 4: 0
line 5: 8
line 6: 16
line 7: 21
line 9: 32
line 11: 40
StackMapTable: number_of_entries = 2
frame_type = 253 /* append */
offset_delta = 32
locals = [ class java/lang/Object, class java/lang/Object ]
frame_type = 7 /* same */
}