3 Levels of Java

The Java Program

public class CS221Test{
    public static void main(String[] args){
        int r;
        r = 3;

        double x;
        x = 3.14 * r * r; 

        System.out.println(x);
    }
}

Java Dissassembled Byte Code

Compiled from CS221Test.java
public class CS221Test extends java.lang.Object {
    public CS221Test();
    public static void main(java.lang.String[]);
}

Method CS221Test()
   0 aload_0
   1 invokespecial #1 
   4 return

Line numbers for method CS221Test()
   line 1: 0

Local variables for method CS221Test()
   CS221Test this  pc=0, length=5, slot=0

Method void main(java.lang.String[])
   0 iconst_3
   1 istore_1
   2 ldc2_w #2 < Double 3.14 >
   5 iload_1
   6 i2d
   7 dmul
   8 iload_1
   9 i2d
  10 dmul
  11 dstore_2
  12 getstatic #4 < Field java.io.PrintStream out >
  15 dload_2
  16 invokevirtual #5  < Method void println(double) >
  19 return

Line numbers for method void main(java.lang.String[])
   line 4: 0
   line 7: 2
   line 9: 12
   line 10: 19

Local variables for method void main(java.lang.String[])
   java.lang.String[] args  pc=0, length=20, slot=0
   int r  pc=2, length=17, slot=1
   double x  pc=12, length=7, slot=2

Java Byte Code

00000000: cafe babe 0003 002d 0026 0a00 0700 1906  .......-.&......
00000010: 4009 1eb8 51eb 851f 0900 1a00 1b0a 001c  @...Q...........
00000020: 001d 0700 1e07 001f 0100 063c 696e 6974  ...........<init
00000030: 3e01 0003 2829 5601 0004 436f 6465 0100  >...()V...Code..
00000040: 0f4c 696e 654e 756d 6265 7254 6162 6c65  .LineNumberTable
00000050: 0100 124c 6f63 616c 5661 7269 6162 6c65  ...LocalVariable
00000060: 5461 626c 6501 0004 7468 6973 0100 0b4c  Table...this...L
00000070: 4353 3232 3154 6573 743b 0100 046d 6169  CS221Test;...mai
00000080: 6e01 0016 285b 4c6a 6176 612f 6c61 6e67  n...([Ljava/lang
00000090: 2f53 7472 696e 673b 2956 0100 0461 7267  /String;)V...arg
000000a0: 7301 0013 5b4c 6a61 7661 2f6c 616e 672f  s...[Ljava/lang/
000000b0: 5374 7269 6e67 3b01 0001 7201 0001 4901  String;...r...I.
000000c0: 0001 7801 0001 4401 000a 536f 7572 6365  ..x...D...Source
000000d0: 4669 6c65 0100 0e43 5332 3231 5465 7374  File...CS221Test
000000e0: 2e6a 6176 610c 0008 0009 0700 200c 0021  .java....... ..!
000000f0: 0022 0700 230c 0024 0025 0100 0943 5332  ."..#..$.%...CS2
00000100: 3231 5465 7374 0100 106a 6176 612f 6c61  21Test...java/la
00000110: 6e67 2f4f 626a 6563 7401 0010 6a61 7661  ng/Object...java
00000120: 2f6c 616e 672f 5379 7374 656d 0100 036f  /lang/System...o
00000130: 7574 0100 154c 6a61 7661 2f69 6f2f 5072  ut...Ljava/io/Pr
00000140: 696e 7453 7472 6561 6d3b 0100 136a 6176  intStream;...jav
00000150: 612f 696f 2f50 7269 6e74 5374 7265 616d  a/io/PrintStream
00000160: 0100 0770 7269 6e74 6c6e 0100 0428 4429  ...println...(D)
00000170: 5600 2100 0600 0700 0000 0000 0200 0100  V.!.............
00000180: 0800 0900 0100 0a00 0000 2f00 0100 0100  ........../.....
00000190: 0000 052a b700 01b1 0000 0002 000b 0000  ...*............
000001a0: 0006 0001 0000 0001 000c 0000 000c 0001  ................
000001b0: 0000 0005 000d 000e 0000 0009 000f 0010  ................
000001c0: 0001 000a 0000 005e 0004 0004 0000 0014  .......^........
000001d0: 063c 1400 021b 876b 1b87 6b49 b200 0428  .<.....k..kI...(
000001e0: b600 05b1 0000 0002 000b 0000 0012 0004  ................
000001f0: 0000 0004 0002 0007 000c 0009 0013 000a  ................
00000200: 000c 0000 0020 0003 0000 0014 0011 0012  ..... ..........
00000210: 0000 0002 0011 0013 0014 0001 000c 0007  ................
00000220: 0015 0016 0002 0001 0017 0000 0002 0018  ................

Last modified: Thu Jan 18 11:48:50 Eastern Standard Time 2001