I am trying to understand the structure of .class file in Java.
Wrote a very simple program :

    package javautilities;

    public class Class_File_Structure {

        public static void main(String[] args) {
            int a = 10;
            int b = 20;
            int c = a + b;        
        }
    }

used the command javap -verbose Class_File_Structure.class
and the results are :

/*
Classfile /C:.../Class_File_Structure.class
  Last modified 31 mar 2014; size 499 bytes
  MD5 checksum 25f2237144af07e2832d78f4b16e015a
  Compiled from "Class_File_Structure.java"
public class javautilities.Class_File_Structure
  SourceFile: "Class_File_Structure.java"
  minor version: 0
  major version: 51
  flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
   #1 = Methodref          #3.#21         //  java/lang/Object."<init>":()V
   #2 = Class              #22            //  javautilities/Class_File_Structure

   #3 = Class              #23            //  java/lang/Object
   #4 = Utf8               <init>
   #5 = Utf8               ()V
   #6 = Utf8               Code
   #7 = Utf8               LineNumberTable
   #8 = Utf8               LocalVariableTable
   #9 = Utf8               this
  #10 = Utf8               Ljavautilities/Class_File_Structure;
  #11 = Utf8               main
  #12 = Utf8               ([Ljava/lang/String;)V
  #13 = Utf8               args
  #14 = Utf8               [Ljava/lang/String;
  #15 = Utf8               a
  #16 = Utf8               I
  #17 = Utf8               b
  #18 = Utf8               c
  #19 = Utf8               SourceFile
  #20 = Utf8               Class_File_Structure.java
  #21 = NameAndType        #4:#5          //  "<init>":()V
  #22 = Utf8               javautilities/Class_File_Structure
  #23 = Utf8               java/lang/Object
{
  public javautilities.Class_File_Structure();
    flags: ACC_PUBLIC
    Code:
      stack=1, locals=1, args_size=1
         0: aload_0
         1: invokespecial #1             // Method java/lang/Object."<init>":()V
         4: return
      LineNumberTable:
        line 3: 0
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
               0       5     0  this   Ljavautilities/Class_File_Structure;

  public static void main(java.lang.String[]);
    flags: ACC_PUBLIC, ACC_STATIC
    Code:
      stack=2, locals=4, args_size=1
         0: bipush        10
         2: istore_1
         3: bipush        20
         5: istore_2
         6: iload_1
         7: iload_2
         8: iadd
         9: istore_3
        10: return
      LineNumberTable:
        line 6: 0
        line 7: 3
        line 8: 6
        line 9: 10
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
               0      11     0  args   [Ljava/lang/String;
               3       8     1     a   I
               6       5     2     b   I
              10       1     3     c   I
}

*/

I read that the format should be

ClassFile {
    u4             magic;
    u2             minor_version;
    u2             major_version;
    u2             constant_pool_count;
    cp_info        constant_pool[constant_pool_count-1];
    u2             access_flags;
    u2             this_class;
    u2             super_class;
    u2             interfaces_count;
    u2             interfaces[interfaces_count];
    u2             fields_count;
    field_info     fields[fields_count];
    u2             methods_count;
    method_info    methods[methods_count];
    u2             attributes_count;
    attribute_info attributes[attributes_count];
}

but can someone explain the output because it is not very clear to me.

Recommended Answers

All 3 Replies

After a lot of reading i ended up with this :

lines 8 , 9 = minor , major version of java compiler
line 10 = access modifiers
line 11 starts the description of pool of constants for the class.
line 12 is of type (CONSTANT_Methodref) which in turn has class_index Reference(a value that points somewhere in constant pool) to the class containing the method and a name_and_type_index.

class_index value is #3 = number of a structure(array ?) in constant pool.
the (CONSTANT_Class_info structure) .

This structure has name_index with value #23 which points to a structure of type (CONSTANT_Utf8_info) which has other fields that finally ends up with string "java/lang/Object"

The name_and_type_index is of type (CONSTANT_NameAndType) . It's value is #21 = number of structure of type (CONSTANT_NameAndType_info).

this structure has :
a)a name_index = #4 in constant pool of type CONSTANT_Utf8_info which is ... "<init>"

b) a descriptor_index = #5 in constant pool of type CONSTANT_Utf8_info which is ... "()V". means Void()

And so on ...

Foolowing the details about how stack is organized , the instructions (opcode and operands )

I hope i understood correct this consept. Please place your comments.

not compiler version, file format version.
Java 6 has compiler version 1.6.x, file format version 50.
Java 7 has compiler version 1.7.x, file format version 51.
Java 8 has compiler version 1.8.x, file format version 52 (I think, don't have that one installed to check).

A Java 6 compiled class with an inner class gives the following:

 C:\projects\sandbox\build\classes>javap -classpath . -verbose sandbox.NewClass
 Compiled from "NewClass.java"
 public class sandbox.NewClass extends java.lang.Object
   SourceFile: "NewClass.java"
   InnerClass:
    public #5= #4 of #2; //Inner=class sandbox/NewClass$Inner of class sandbox/Ne
 wClass
   minor version: 0
   major version: 50
   Constant pool:
 const #1 = Method       #3.#16; //  java/lang/Object."<init>":()V
 const #2 = class        #17;    //  sandbox/NewClass
 const #3 = class        #18;    //  java/lang/Object
 const #4 = class        #19;    //  sandbox/NewClass$Inner
 const #5 = Asciz        Inner;
 const #6 = Asciz        InnerClasses;
 const #7 = Asciz        <init>;
 const #8 = Asciz        ()V;
 const #9 = Asciz        Code;
 const #10 = Asciz       LineNumberTable;
 const #11 = Asciz       LocalVariableTable;
 const #12 = Asciz       this;
 const #13 = Asciz       Lsandbox/NewClass;;
 const #14 = Asciz       SourceFile;
 const #15 = Asciz       NewClass.java;
 const #16 = NameAndType #7:#8;//  "<init>":()V
 const #17 = Asciz       sandbox/NewClass;
 const #18 = Asciz       java/lang/Object;
 const #19 = Asciz       sandbox/NewClass$Inner;

 {
 public sandbox.NewClass();
   Code:
    Stack=1, Locals=1, Args_size=1
    0:   aload_0
    1:   invokespecial   #1; //Method java/lang/Object."<init>":()V
    4:   return
   LineNumberTable:
    line 13: 0
    line 15: 4

   LocalVariableTable:
    Start  Length  Slot  Name   Signature
    0      5      0    this       Lsandbox/NewClass;


 }

The "class" and "method" entries seem to be imported classes and the methods called on them (remember classes in java.lang and the current package are imported implicitly if needed, hence are present).
To make that clear however you need a more complex example :)

Compiled from "ZipTest.java"
public class sandbox.ZipTest extends java.lang.Object
  SourceFile: "ZipTest.java"
  minor version: 0
  major version: 50
  Constant pool:
const #1 = Method       #38.#92;        //  java/lang/Object."<init>":()V
const #2 = class        #93;    //  java/util/zip/ZipOutputStream
const #3 = Method       #2.#94; //  java/util/zip/ZipOutputStream."<init>":(Ljav
a/io/OutputStream;)V
const #4 = class        #95;    //  java/util/zip/ZipEntry
const #5 = Method       #16.#96;        //  java/io/File.getName:()Ljava/lang/St
ring;
const #6 = Method       #4.#97; //  java/util/zip/ZipEntry."<init>":(Ljava/lang/
String;)V
const #7 = Method       #2.#98; //  java/util/zip/ZipOutputStream.putNextEntry:(
Ljava/util/zip/ZipEntry;)V
const #8 = class        #99;    //  java/io/FileInputStream
const #9 = Method       #8.#100;        //  java/io/FileInputStream."<init>":(Lj
ava/io/File;)V
const #10 = Method      #8.#101;        //  java/io/FileInputStream.read:([B)I
const #11 = Method      #2.#102;        //  java/util/zip/ZipOutputStream.write:
([BII)V
const #12 = Method      #8.#103;        //  java/io/FileInputStream.close:()V
const #13 = Method      #2.#104;        //  java/util/zip/ZipOutputStream.closeE
ntry:()V
const #14 = class       #105;   //  sandbox/ZipTest
const #15 = Method      #14.#92;        //  sandbox/ZipTest."<init>":()V
const #16 = class       #106;   //  java/io/File
const #17 = class       #107;   //  java/lang/StringBuilder
const #18 = Method      #17.#92;        //  java/lang/StringBuilder."<init>":()V
const #19 = String      #108;   //  c:/tmp/
const #20 = Method      #17.#109;       //  java/lang/StringBuilder.append:(Ljav
a/lang/String;)Ljava/lang/StringBuilder;
const #21 = Method      #17.#110;       //  java/lang/StringBuilder.append:(I)Lj
ava/lang/StringBuilder;
const #22 = String      #111;   //  .txt
const #23 = Method      #17.#112;       //  java/lang/StringBuilder.toString:()L
java/lang/String;
const #24 = Method      #16.#97;        //  java/io/File."<init>":(Ljava/lang/St
ring;)V
const #25 = Method      #16.#113;       //  java/io/File.createNewFile:()Z
const #26 = class       #114;   //  java/io/FileWriter
const #27 = Method      #26.#100;       //  java/io/FileWriter."<init>":(Ljava/i
o/File;)V
const #28 = String      #115;   //  In the frozen land of Nador they were forced
 to eat Robin's minstrells, and there was much rejoicing.
const #29 = Method      #26.#116;       //  java/io/FileWriter.write:(Ljava/lang
/String;)V
const #30 = Method      #26.#117;       //  java/io/FileWriter.flush:()V
const #31 = Method      #26.#103;       //  java/io/FileWriter.close:()V
const #32 = String      #118;   //  c:/tmp/test.zip
const #33 = class       #119;   //  java/io/FileOutputStream
const #34 = Method      #33.#100;       //  java/io/FileOutputStream."<init>":(L
java/io/File;)V
const #35 = Method      #14.#120;       //  sandbox/ZipTest.zip:([Ljava/io/File;
Ljava/io/OutputStream;)Ljava/io/OutputStream;
const #36 = Method      #121.#117;      //  java/io/OutputStream.flush:()V
const #37 = Method      #121.#103;      //  java/io/OutputStream.close:()V
const #38 = class       #122;   //  java/lang/Object
const #39 = Asciz       <init>;
const #40 = Asciz       ()V;
const #41 = Asciz       Code;
const #42 = Asciz       LineNumberTable;
const #43 = Asciz       LocalVariableTable;
const #44 = Asciz       this;
const #45 = Asciz       Lsandbox/ZipTest;;
const #46 = Asciz       zip;
const #47 = Asciz       ([Ljava/io/File;Ljava/io/OutputStream;)Ljava/io/OutputSt
ream;;
const #48 = Asciz       fis;
const #49 = Asciz       Ljava/io/FileInputStream;;
const #50 = Asciz       len;
const #51 = Asciz       I;
const #52 = Asciz       buffer;
const #53 = Asciz       [B;
const #54 = Asciz       f;
const #55 = Asciz       Ljava/io/File;;
const #56 = Asciz       entry;
const #57 = Asciz       Ljava/util/zip/ZipEntry;;
const #58 = Asciz       arr$;
const #59 = Asciz       [Ljava/io/File;;
const #60 = Asciz       len$;
const #61 = Asciz       i$;
const #62 = Asciz       files;
const #63 = Asciz       ostream;
const #64 = Asciz       Ljava/io/OutputStream;;
const #65 = Asciz       z;
const #66 = Asciz       Ljava/util/zip/ZipOutputStream;;
const #67 = Asciz       StackMapTable;
const #68 = class       #105;   //  sandbox/ZipTest
const #69 = class       #59;    //  "[Ljava/io/File;"
const #70 = class       #123;   //  java/io/OutputStream
const #71 = class       #93;    //  java/util/zip/ZipOutputStream
const #72 = class       #95;    //  java/util/zip/ZipEntry
const #73 = class       #106;   //  java/io/File
const #74 = class       #99;    //  java/io/FileInputStream
const #75 = class       #53;    //  "[B"
const #76 = Asciz       Exceptions;
const #77 = class       #124;   //  java/io/IOException
const #78 = Asciz       main;
const #79 = Asciz       ([Ljava/lang/String;)V;
const #80 = Asciz       w;
const #81 = Asciz       Ljava/io/FileWriter;;
const #82 = Asciz       args;
const #83 = Asciz       [Ljava/lang/String;;
const #84 = Asciz       test;
const #85 = Asciz       c;
const #86 = Asciz       fos;
const #87 = Asciz       Ljava/io/FileOutputStream;;
const #88 = class       #83;    //  "[Ljava/lang/String;"
const #89 = class       #125;   //  java/lang/Exception
const #90 = Asciz       SourceFile;
const #91 = Asciz       ZipTest.java;
const #92 = NameAndType #39:#40;//  "<init>":()V
const #93 = Asciz       java/util/zip/ZipOutputStream;
const #94 = NameAndType #39:#126;//  "<init>":(Ljava/io/OutputStream;)V
const #95 = Asciz       java/util/zip/ZipEntry;
const #96 = NameAndType #127:#128;//  getName:()Ljava/lang/String;
const #97 = NameAndType #39:#129;//  "<init>":(Ljava/lang/String;)V
const #98 = NameAndType #130:#131;//  putNextEntry:(Ljava/util/zip/ZipEntry;)V
const #99 = Asciz       java/io/FileInputStream;
const #100 = NameAndType        #39:#132;//  "<init>":(Ljava/io/File;)V
const #101 = NameAndType        #133:#134;//  read:([B)I
const #102 = NameAndType        #135:#136;//  write:([BII)V
const #103 = NameAndType        #137:#40;//  close:()V
const #104 = NameAndType        #138:#40;//  closeEntry:()V
const #105 = Asciz      sandbox/ZipTest;
const #106 = Asciz      java/io/File;
const #107 = Asciz      java/lang/StringBuilder;
const #108 = Asciz      c:/tmp/;
const #109 = NameAndType        #139:#140;//  append:(Ljava/lang/String;)Ljava/l
ang/StringBuilder;
const #110 = NameAndType        #139:#141;//  append:(I)Ljava/lang/StringBuilder
;
const #111 = Asciz      .txt;
const #112 = NameAndType        #142:#128;//  toString:()Ljava/lang/String;
const #113 = NameAndType        #143:#144;//  createNewFile:()Z
const #114 = Asciz      java/io/FileWriter;
const #115 = Asciz      In the frozen land of Nador they were forced to eat Robi
n's minstrells, and there was much rejoicing.;
const #116 = NameAndType        #135:#129;//  write:(Ljava/lang/String;)V
const #117 = NameAndType        #145:#40;//  flush:()V
const #118 = Asciz      c:/tmp/test.zip;
const #119 = Asciz      java/io/FileOutputStream;
const #120 = NameAndType        #46:#47;//  zip:([Ljava/io/File;Ljava/io/OutputS
tream;)Ljava/io/OutputStream;
const #121 = class      #123;   //  java/io/OutputStream
const #122 = Asciz      java/lang/Object;
const #123 = Asciz      java/io/OutputStream;
const #124 = Asciz      java/io/IOException;
const #125 = Asciz      java/lang/Exception;
const #126 = Asciz      (Ljava/io/OutputStream;)V;
const #127 = Asciz      getName;
const #128 = Asciz      ()Ljava/lang/String;;
const #129 = Asciz      (Ljava/lang/String;)V;
const #130 = Asciz      putNextEntry;
const #131 = Asciz      (Ljava/util/zip/ZipEntry;)V;
const #132 = Asciz      (Ljava/io/File;)V;
const #133 = Asciz      read;
const #134 = Asciz      ([B)I;
const #135 = Asciz      write;
const #136 = Asciz      ([BII)V;
const #137 = Asciz      close;
const #138 = Asciz      closeEntry;
const #139 = Asciz      append;
const #140 = Asciz      (Ljava/lang/String;)Ljava/lang/StringBuilder;;
const #141 = Asciz      (I)Ljava/lang/StringBuilder;;
const #142 = Asciz      toString;
const #143 = Asciz      createNewFile;
const #144 = Asciz      ()Z;
const #145 = Asciz      flush;

{
public sandbox.ZipTest();
  Code:
   Stack=1, Locals=1, Args_size=1
   0:   aload_0
   1:   invokespecial   #1; //Method java/lang/Object."<init>":()V
   4:   return
  LineNumberTable:
   line 22: 0

  LocalVariableTable:
   Start  Length  Slot  Name   Signature
   0      5      0    this       Lsandbox/ZipTest;


public java.io.OutputStream zip(java.io.File[], java.io.OutputStream)   throws j
ava.io.IOException;
  Code:
   Stack=4, Locals=12, Args_size=3
   0:   new     #2; //class java/util/zip/ZipOutputStream
   3:   dup
   4:   aload_2
   5:   invokespecial   #3; //Method java/util/zip/ZipOutputStream."<init>":(Lja
va/io/OutputStream;)V
   8:   astore_3
   9:   aload_1
   10:  astore  5
   12:  aload   5
   14:  arraylength
   15:  istore  6
   17:  iconst_0
   18:  istore  7
   20:  iload   7
   22:  iload   6
   24:  if_icmpge       112
   27:  aload   5
   29:  iload   7
   31:  aaload
   32:  astore  8
   34:  new     #4; //class java/util/zip/ZipEntry
   37:  dup
   38:  aload   8
   40:  invokevirtual   #5; //Method java/io/File.getName:()Ljava/lang/String;
   43:  invokespecial   #6; //Method java/util/zip/ZipEntry."<init>":(Ljava/lang
/String;)V
   46:  astore  4
   48:  aload_3
   49:  aload   4
   51:  invokevirtual   #7; //Method java/util/zip/ZipOutputStream.putNextEntry:
(Ljava/util/zip/ZipEntry;)V
   54:  new     #8; //class java/io/FileInputStream
   57:  dup
   58:  aload   8
   60:  invokespecial   #9; //Method java/io/FileInputStream."<init>":(Ljava/io/
File;)V
   63:  astore  9
   65:  sipush  1024
   68:  newarray byte
   70:  astore  11
   72:  aload   9
   74:  aload   11
   76:  invokevirtual   #10; //Method java/io/FileInputStream.read:([B)I
   79:  dup
   80:  istore  10
   82:  ifle    97
   85:  aload_3
   86:  aload   11
   88:  iconst_0
   89:  iload   10
   91:  invokevirtual   #11; //Method java/util/zip/ZipOutputStream.write:([BII)
V
   94:  goto    72
   97:  aload   9
   99:  invokevirtual   #12; //Method java/io/FileInputStream.close:()V
   102: aload_3
   103: invokevirtual   #13; //Method java/util/zip/ZipOutputStream.closeEntry:(
)V
   106: iinc    7, 1
   109: goto    20
   112: aload_3
   113: areturn
  LineNumberTable:
   line 28: 0
   line 29: 9
   line 30: 34
   line 31: 48
   line 32: 54
   line 34: 65
   line 35: 72
   line 36: 85
   line 38: 97
   line 39: 102
   line 29: 106
   line 42: 112

  LocalVariableTable:
   Start  Length  Slot  Name   Signature
   65      41      9    fis       Ljava/io/FileInputStream;
   82      24      10    len       I
   72      34      11    buffer       [B
   34      72      8    f       Ljava/io/File;
   48      64      4    entry       Ljava/util/zip/ZipEntry;
   12      100      5    arr$       [Ljava/io/File;
   17      95      6    len$       I
   20      92      7    i$       I
   0      114      0    this       Lsandbox/ZipTest;
   0      114      1    files       [Ljava/io/File;
   0      114      2    ostream       Ljava/io/OutputStream;
   9      105      3    z       Ljava/util/zip/ZipOutputStream;

  StackMapTable: number_of_entries = 4
   frame_type = 255 /* full_frame */
     offset_delta = 20
     locals = [ class sandbox/ZipTest, class "[Ljava/io/File;", class java/io/Ou
tputStream, class java/util/zip/ZipOutputStream, bogus, class "[Ljava/io/File;",
 int, int ]
     stack = []
   frame_type = 255 /* full_frame */
     offset_delta = 51
     locals = [ class sandbox/ZipTest, class "[Ljava/io/File;", class java/io/Ou
tputStream, class java/util/zip/ZipOutputStream, class java/util/zip/ZipEntry, c
lass "[Ljava/io/File;", int, int, class java/io/File, class java/io/FileInputStr
eam, bogus, class "[B" ]
     stack = []
   frame_type = 255 /* full_frame */
     offset_delta = 24
     locals = [ class sandbox/ZipTest, class "[Ljava/io/File;", class java/io/Ou
tputStream, class java/util/zip/ZipOutputStream, class java/util/zip/ZipEntry, c
lass "[Ljava/io/File;", int, int, class java/io/File, class java/io/FileInputStr
eam, int, class "[B" ]
     stack = []
   frame_type = 255 /* full_frame */
     offset_delta = 14
     locals = [ class sandbox/ZipTest, class "[Ljava/io/File;", class java/io/Ou
tputStream, class java/util/zip/ZipOutputStream ]
     stack = []

  Exceptions:
   throws java.io.IOException
public static void main(java.lang.String[])   throws java.lang.Exception;
  Code:
   Stack=4, Locals=9, Args_size=1
   0:   new     #14; //class sandbox/ZipTest
   3:   dup
   4:   invokespecial   #15; //Method "<init>":()V
   7:   astore_1
   8:   bipush  10
   10:  anewarray       #16; //class java/io/File
   13:  astore_2
   14:  iconst_0
   15:  istore_3
   16:  aload_2
   17:  astore  4
   19:  aload   4
   21:  arraylength
   22:  istore  5
   24:  iconst_0
   25:  istore  6
   27:  iload   6
   29:  iload   5
   31:  if_icmpge       122
   34:  aload   4
   36:  iload   6
   38:  aaload
   39:  astore  7
   41:  new     #16; //class java/io/File
   44:  dup
   45:  new     #17; //class java/lang/StringBuilder
   48:  dup
   49:  invokespecial   #18; //Method java/lang/StringBuilder."<init>":()V
   52:  ldc     #19; //String c:/tmp/
   54:  invokevirtual   #20; //Method java/lang/StringBuilder.append:(Ljava/lang
/String;)Ljava/lang/StringBuilder;
   57:  iload_3
   58:  invokevirtual   #21; //Method java/lang/StringBuilder.append:(I)Ljava/la
ng/StringBuilder;
   61:  ldc     #22; //String .txt
   63:  invokevirtual   #20; //Method java/lang/StringBuilder.append:(Ljava/lang
/String;)Ljava/lang/StringBuilder;
   66:  invokevirtual   #23; //Method java/lang/StringBuilder.toString:()Ljava/l
ang/String;
   69:  invokespecial   #24; //Method java/io/File."<init>":(Ljava/lang/String;)
V
   72:  astore  7
   74:  aload_2
   75:  iload_3
   76:  iinc    3, 1
   79:  aload   7
   81:  aastore
   82:  aload   7
   84:  invokevirtual   #25; //Method java/io/File.createNewFile:()Z
   87:  pop
   88:  new     #26; //class java/io/FileWriter
   91:  dup
   92:  aload   7
   94:  invokespecial   #27; //Method java/io/FileWriter."<init>":(Ljava/io/File
;)V
   97:  astore  8
   99:  aload   8
   101: ldc     #28; //String In the frozen land of Nador they were forced to ea
t Robin's minstrells, and there was much rejoicing.
   103: invokevirtual   #29; //Method java/io/FileWriter.write:(Ljava/lang/Strin
g;)V
   106: aload   8
   108: invokevirtual   #30; //Method java/io/FileWriter.flush:()V
   111: aload   8
   113: invokevirtual   #31; //Method java/io/FileWriter.close:()V
   116: iinc    6, 1
   119: goto    27
   122: new     #16; //class java/io/File
   125: dup
   126: ldc     #32; //String c:/tmp/test.zip
   128: invokespecial   #24; //Method java/io/File."<init>":(Ljava/lang/String;)
V
   131: astore  4
   133: aload   4
   135: invokevirtual   #25; //Method java/io/File.createNewFile:()Z
   138: pop
   139: new     #33; //class java/io/FileOutputStream
   142: dup
   143: aload   4
   145: invokespecial   #34; //Method java/io/FileOutputStream."<init>":(Ljava/i
o/File;)V
   148: astore  5
   150: aload_1
   151: aload_2
   152: aload   5
   154: invokevirtual   #35; //Method zip:([Ljava/io/File;Ljava/io/OutputStream;
)Ljava/io/OutputStream;
   157: astore  6
   159: aload   6
   161: invokevirtual   #36; //Method java/io/OutputStream.flush:()V
   164: aload   6
   166: invokevirtual   #37; //Method java/io/OutputStream.close:()V
   169: return
  LineNumberTable:
   line 46: 0
   line 48: 8
   line 49: 14
   line 50: 16
   line 51: 41
   line 52: 74
   line 53: 82
   line 54: 88
   line 55: 99
   line 56: 106
   line 57: 111
   line 50: 116
   line 59: 122
   line 60: 133
   line 61: 139
   line 62: 150
   line 63: 159
   line 64: 164
   line 65: 169

  LocalVariableTable:
   Start  Length  Slot  Name   Signature
   99      17      8    w       Ljava/io/FileWriter;
   41      75      7    f       Ljava/io/File;
   19      103      4    arr$       [Ljava/io/File;
   24      98      5    len$       I
   27      95      6    i$       I
   0      170      0    args       [Ljava/lang/String;
   8      162      1    test       Lsandbox/ZipTest;
   14      156      2    files       [Ljava/io/File;
   16      154      3    c       I
   133      37      4    f       Ljava/io/File;
   150      20      5    fos       Ljava/io/FileOutputStream;
   159      11      6    z       Ljava/io/OutputStream;

  StackMapTable: number_of_entries = 2
   frame_type = 255 /* full_frame */
     offset_delta = 27
     locals = [ class "[Ljava/lang/String;", class sandbox/ZipTest, class "[Ljav
a/io/File;", int, class "[Ljava/io/File;", int, int ]
     stack = []
   frame_type = 248 /* chop */
     offset_delta = 94

  Exceptions:
   throws java.lang.Exception
}

java/lang/Object is present because every class in java derived from Object.
And of cource inherits the instance methods of Object.

java/lang/Object."<init>":()V means a call to Object constructor.

<init> = special name for instance initialization method.

Instance initialization methods may be invoked only within the Java virtual machine by the invokespecial instruction.

In Bill Venners book "JavaWorld" says :
When you compile a class, the Java compiler creates an instance initialization method for each constructor you declare in the source code of the class. Although the constructor is not a method, the instance initialization method is. It has a name, <init>, a return type, void, and a set of parameters that match the parameters of the constructor from which it was generated. ...(<init> is not a method in the Java language sense of the term, because it has an illegal name. In the compiled, binary Java class file, however, it is a legal method.)

So the first Method call by the invokespecial instruction is the <init> method call.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.