常量池在java用于保存在编译期已确定的,已编译的class文件中的一份数据。它包括了关于类,方法,接口等中的常量,也包括字符串常量,如String s = "java"这种申明方式;当然也可扩充,执行器产生的常量也会放入常量池,故认为常量池是JVM的一块特殊的内存空间。
常量池(constant pool):在编译期被确定,并被保存在已编译的.class文件中的一些数据,它包括了关于类、方法、接口等中的常量,也包括字符串常量。
基于438个网页-相关网页
每个桢都包括一个运行期常量池(runtime constant pool)的引用,帮助当前方法动态链接方法的代码。class文件中的方法代码通过符号引用(symbolic references)指向被调用的方法和需要访...
基于82个网页-相关网页
String 不变性的另外一个可以优化的地方,就是常量池(String pool),对于短小的String对象,保存到String pool中,如果遇到同样的String,则只要复用String pool中的实例就可以了 。
基于24个网页-相关网页
其他的例子有字符串的地址和常量池入口的内部位置。
Other examples are addresses of strings and the internal locations of constant pool entries.
常量池往往占到二进制类大小的一半或更多,但平均下来可能要少一些。
The constant pool can easily make up half or more of the binary class size, though the average proportion is probably less.
项总数(本例中,是26,或0x001a)后面是实际的常量池数据。
The entry count (in this case 26, or 0x001a) is followed by the actual constant pool data.
应用推荐