Java常量池详细说明
java常量池技术
java中的常量池技术,是为了方便快捷地创建某些对象而出现的,当需要一个对象时,就可以从池中取一个出来(如果池中没有则创建一个),则在需要重复创建相等变量时节省了很多时间。常量池其实也就是一个内存空间,常量池存在于方法区中
Constant pool:
#1 = Methodref #32.#86 // java/lang/Object."<init>":()V
#2 = Fieldref #31.#87 // com/bookStore/commons/beans/User.id:Ljava/lang/Integer;
#3 = Fieldref #31.#88 // com/bookStore/commons/beans/User.username:Ljava/lang/String;
#4 = Fieldref #31.#89 // com/bookStore/commons/beans/User.password:Ljava/lang/String;
#5 = Fieldref #31.#90 // com/bookStore/commons/beans/User.gender:Ljava/lang/String;
#6 = Fieldref #31.#91 // com/bookStore/commons/beans/User.email:Ljava/lang/String;
#7 = Fieldref #31.#92 // com/bookStore/commons/beans/User.telephone:Ljava/lang/String;
#8 = Fieldref #31.#93 // com/bookStore/commons/beans/User.introduce:Ljava/lang/String;
#9 = Fieldref #31.#94 // com/bookStore/commons/beans/User.activeCode:Ljava/lang/String;
#10 = Fieldref #31.#95 // com/bookStore/commons/beans/User.state:I
#11 = Fieldref #31.#96 // com/bookStore/commons/beans/User.registTime:Ljava/util/Date;
#12 = Fieldref #31.#97 // com/bookStore/commons/beans/User.role:Ljava/lang/String;
#13 = Class #98 // java/lang/StringBuilder
#14 = Methodref #13.#86 // java/lang/StringBuilder."<init>":()V
#15 = String #99 // User{id=
#16 = Methodref #13.#100 // java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
#17 = Methodref #13.#101 // java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
#18 = String #102 // , username=\'
#19 = Methodref #13.#103 // java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
#20 = String #104 // , password=\'
#21 = String #105 // , gender=\'
#22 = String #106 // , email=\'
#23 = String #107 // , telephone=\'
#24 = String #108 // , introduce=\'
#25 = String #109 // , activeCode=\'
#26 = String #110 // , state=
#27 = Methodref #13.#111 // java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
#28 = String #112 // , role=\'
#29 = String #113 // , registTime=
#30 = Methodref #13.#114 // java/lang/StringBuilder.toString:()Ljava/lang/String;
#31 = Class #115 // com/bookStore/commons/beans/User
#32 = Class #116 // java/lang/Object
#33 = Utf8 id
#34 = Utf8 Ljava/lang/Integer;
#35 = Utf8 username
#36 = Utf8 Ljava/lang/String;
#37 = Utf8 password
#38 = Utf8 gender
#39 = Utf8 email
#40 = Utf8 telephone
#41 = Utf8 introduce
#42 = Utf8 activeCode
#43 = Utf8 state
#44 = Utf8 I
#45 = Utf8 role
#46 = Utf8 registTime
#47 = Utf8 Ljava/util/Date;
#48 = Utf8 <init>
#49 = Utf8 ()V
#50 = Utf8 Code
#51 = Utf8 LineNumberTable
#52 = Utf8 LocalVariableTable
#53 = Utf8 this
#54 = Utf8 Lcom/bookStore/commons/beans/User;
#55 = Utf8 getId
#56 = Utf8 ()Ljava/lang/Integer;
#57 = Utf8 setId
#58 = Utf8 (Ljava/lang/Integer;)V
#59 = Utf8 getUsername
#60 = Utf8 ()Ljava/lang/String;
#61 = Utf8 setUsername
#62 = Utf8 (Ljava/lang/String;)V
#63 = Utf8 getPassword
#64 = Utf8 setPassword
#65 = Utf8 getGender
#66 = Utf8 setGender
#67 = Utf8 getEmail
#68 = Utf8 setEmail
#69 = Utf8 getTelephone
#70 = Utf8 setTelephone
#71 = Utf8 getIntroduce
#72 = Utf8 setIntroduce
#73 = Utf8 getActiveCode
#74 = Utf8 setActiveCode
#75 = Utf8 getState
#76 = Utf8 ()I
#77 = Utf8 setState
#78 = Utf8 (I)V
#79 = Utf8 setRegistTime
#80 = Utf8 (Ljava/util/Date;)V
#81 = Utf8 getRole
#82 = Utf8 setRole
#83 = Utf8 toString
#84 = Utf8 SourceFile
#85 = Utf8 User.java
#86 = NameAndType #48:#49 // "<init>":()V
#87 = NameAndType #33:#34 // id:Ljava/lang/Integer;
#88 = NameAndType #35:#36 // username:Ljava/lang/String;
#89 = NameAndType #37:#36 // password:Ljava/lang/String;
#90 = NameAndType #38:#36 // gender:Ljava/lang/String;
#91 = NameAndType #39:#36 // email:Ljava/lang/String;
#92 = NameAndType #40:#36 // telephone:Ljava/lang/String;
#93 = NameAndType #41:#36 // introduce:Ljava/lang/String;
#94 = NameAndType #42:#36 // activeCode:Ljava/lang/String;
#95 = NameAndType #43:#44 // state:I
#96 = NameAndType #46:#47 // registTime:Ljava/util/Date;
#97 = NameAndType #45:#36 // role:Ljava/lang/String;
#98 = Utf8 java/lang/StringBuilder
#99 = Utf8 User{id=
#100 = NameAndType #117:#118 // append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
#101 = NameAndType #117:#119 // append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
#102 = Utf8 , username=\'
#103 = NameAndType #117:#120 // append:(C)Ljava/lang/StringBuilder;
#104 = Utf8 , password=\'
#105 = Utf8 , gender=\'
#106 = Utf8 , email=\'
#107 = Utf8 , telephone=\'
#108 = Utf8 , introduce=\'
#109 = Utf8 , activeCode=\'
#110 = Utf8 , state=
#111 = NameAndType #117:#121 // append:(I)Ljava/lang/StringBuilder;
#112 = Utf8 , role=\'
#113 = Utf8 , registTime=
#114 = NameAndType #83:#60 // toString:()Ljava/lang/String;
#115 = Utf8 com/bookStore/commons/beans/User
#116 = Utf8 java/lang/Object
#117 = Utf8 append
#118 = Utf8 (Ljava/lang/String;)Ljava/lang/StringBuilder;
#119 = Utf8 (Ljava/lang/Object;)Ljava/lang/StringBuilder;
#120 = Utf8 (C)Ljava/lang/StringBuilder;
#121 = Utf8 (I)Ljava/lang/StringBuilder;
Java常量池详细说明的更多相关文章
- 转载:Java中的字符串常量池详细介绍
引用自:http://blog.csdn.net/langhong8/article/details/50938041 这篇文章主要介绍了Java中的字符串常量池详细介绍,JVM为了减少字符串对象的重 ...
- java常量池中基本数据类型包装类的小陷阱
想必大部分学过java的人都应该做过这种题目: public class Test { public static void main(String[] args) { //第一个字符串 String ...
- 触摸java常量池
java常量池是一个经久不衰的话题,也是面试官的最爱,题目花样百出,小菜早就对常量池有所耳闻,这次好好总结一下. 理论 小菜先拙劣的表达一下jvm虚拟内存分布: 程序计数器是jvm执行程序的 ...
- 【转载】Java常量池
本篇随笔为转载,原贴地址:Java常量池理解与总结. (其实Java的常量池有点像C++中的存储字符串常量的常量存储区). 一.相关概念 什么是常量用final修饰的成员变量表示常量,值一旦给定就无法 ...
- java常量池概念
在class文件中,“常量池”是最复杂也最值得关注的内容. Java是一种动态连接的语言,常量池的作用非常重要,常量池中除了包含代码中所定义的各种基本类型(如int.long等等)和对象型(如Stri ...
- java常量池理解
String类两种不同的创建方式 String s1 = "zheng"; //第一种创建方式 String s2 = new String("junxiang" ...
- java虚拟机学习-触摸java常量池(13-1)
java虚拟机学习-深入理解JVM(1) java虚拟机学习-慢慢琢磨JVM(2) java虚拟机学习-慢慢琢磨JVM(2-1)ClassLoader的工作机制 java虚拟机学习-JVM内存管理:深 ...
- java常量池概念 (转)
在class文件中,“常量池”是最复杂也最值得关注的内容. Java是一种动态连接的语言,常量池的作用非常重要,常量池中除了包含代码中所定义的各种基本类型(如int.long等等)和对象型(如Stri ...
- 浅析Java常量池
Java常量池 Java常量池其实分为两种:静态常量池和运行时常量池 1.静态常量池 所谓静态常量池,即*.class文件中的常量池,class文件中的常量池不仅仅包含字符串(数字)字面量,还包含类. ...
随机推荐
- HDU 4509
很简单的排序题而已. #include <iostream> #include <cstdio> #include <algorithm> #include < ...
- IntelliJ IDEA中出现could not auto wired错误提示处理方式
IntelliJ IDEA中出现could not auto wired错误提示处理方式 程序可以正常运行,就是出现错误提示: 学习了:http://blog.csdn.net/xlxxybz1314 ...
- android注解使用具体解释(图文)
在使用Java的SSH框架的时候,一直在感叹注解真是方便啊,关于注解的原理,大家能够參考我的还有一片文章Java注解具体解释. 近期有时间研究了android注解的使用,今天与大家分享一下. andr ...
- 王立平--Failed to pull selection
解决的方法:重新启动eclipse
- Codeforces 510 A.Fox and Snake
题目链接:http://codeforces.com/contest/510/problem/A A. Fox And Snake time limit per test2 seconds memor ...
- Jmeter压测问题_Non HTTP response code: org.apache.http.conn.ConnectTimeoutException
负载机压测,线程500,服务器根本无压力,负载机本身发的请求都是失败的 Sample result如下: Thread Name: 考勤(考勤提交) 1-134 Sample Start: 2018- ...
- 最全Linux 与 Linux Windows 文件共享
前提说明: windows主机信息:192.168.1.100 帐号:abc password:123 共享目录:share linux主机信息:192.168.1.200 帐号:def passwo ...
- webService总结(一)——使用CXF公布和调用webService(不使用Spring)
CXF和Axis2是两个比較流行的webService框架,接下来我会写几篇博客简介怎样使用这两种框架. 首先,先简介一下CXF的使用. CXF公布webService有多种方法.这里我介绍三种: 1 ...
- hibernate初步
Hibernate开发步骤1.新创建工程并且导入相关的包 主要是hibernate.mysql相关的JAR包. 注意:新导入的hibernate相关的JAR包是否与你当前所使用的jdk版本是否兼容,且 ...
- SVM最通俗的解读
摘自:https://www.zhihu.com/question/21094489/answer/86273196 什么是SVM? 当然首先看一下wiki. Support Vector Machi ...