文章目录
一、字符串常量池
二、常量池与运行时常量池
public class T01_ConstantPool {
public static void main(String[] args) {
}
}
Constant pool:
#1 = Methodref #3.#17 // java/lang/Object."<init>":()V
#2 = Class #18 // T01_Pool
#3 = Class #19 // java/lang/Object
#4 = Utf8 <init>
#5 = Utf8 ()V
#6 = Utf8 Code
#7 = Utf8 LineNumberTable
#8 = Utf8 LocalVariableTable
#9 = Utf8 this
#10 = Utf8 T01_ConstantPool;
#11 = Utf8 main
#12 = Utf8 ([Ljava/lang/String;)V
#13 = Utf8 args
#14 = Utf8 [Ljava/lang/String;
#15 = Utf8 SourceFile
#16 = Utf8 T01_ConstantPool.java
#17 = NameAndType #4:#5 // "<init>":()V
#18 = Utf8 T01_Pool
#19 = Utf8 java/lang/Object