1、本文将对Java字节码进行解析,以及一些效率问题。AD:一:Java字节代码的组织形式类文件{OxCAFEBABE,小版本号,大版本号,常量池大小,常量池数组,访问控制标记,当前类信息,父类信息,实现的接口个数,实现的接口信息数组,域个数,域信息数组,方法个数,方法信息数组,属性个数,属性信息数组}二:查看方法---javap命令例子:有一个Java类Demo.java1.public class Demo { 2. private String str1; 3. private String str2; 4. private int num1; 5.
2、 private int num2; 6. public static final String STATIC_DATA = "hello world"; 7. 8. private void sayHello1(){ 9. System.out.println("this is method1..."); 10. } 11. private void sayHello2(){ 12. System.out.println("this is method2..."); 13. } 14. pu
3、blic void sayHello3(){ 15. System.out.println("this is method3..."); 16. } 17.} 通过jdk自带的反编译工具命令javap可以查看class文件的字节码信息D:>javap-verboseDemo>>Demo.txtDemo.txt:1.Compiled from "Demo.java" 2.public class Demo extends java.lang.Object 6/61. SourceFile: "Demo.java" 2. minor version