Hi guys, I have a doubt regarding compilers in Java. Do all the compilers produce the same size of byte code or does the size of the byte code i.e. the .class file varies from compiler to compiler. Actually I'm using Oracle JDeveloper ver 3.2.2 and Forte for Java C.E ver 3.0. When i compiled one of my files in the JDeveloper it gave me a .class file of size 28k whereas the same file compiled in Forte gave a .class file of size 26k. Both class files seem to be working perfectly. Hope somebody throws light in this issue. ------ Arjun
posted 14 years ago
Looks like you've answered your own question. There are often many possible ways to legally translate a Java file into a class file, and different compilers can and do implement this differently. If you're really interested, try using a disassembler like javap (included in Sun's SDK) to see exacly what the class files are doing, and how they are different. Have fun...