java内存(Java Memory).doc

  1. 1、本文档共6页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
java内存(Java Memory)

java内存(Java Memory) About the internal work of String STR = ABC. Within the Java, translate this statement into the following steps: (1) first define an object reference variable named STR for the String class: String str; (2) finds that there is no stored value ABC address on the stack, if not, then opened a store literal ABC address, then create a new String object of class o, and the o string value to the address on the stack, and next to this address write down the reference object o. If you already have an address that is worth ABC, look for the object o and return the address of the o. (3) point the STR to the address of the object o. Continue the JVM principle Original title: thinking about Java stacks and heaps, the 1. stack (stack) and the heap (heap) are all places where Java stores data in Ram. Unlike C++, Java automatically manages stacks and heaps, and programmers cant directly set up stacks or heaps. The advantage of the 2. stack is that the access speed is faster than the heap, second only to the register directly located in the CPU. But the downside is that the data size and lifetime in the stack must be determined and lack of flexibility. In addition, stack data can be shared, see third points. The advantage of a heap is the ability to dynamically allocate memory sizes without having to tell the compiler in advance, and the Java garbage collector automatically takes out the data that is no longer in use. The downside is that access is slower because of the dynamic allocation of memory at runtime. There are two types of data in Java 3. One is the basic type (primitive types), a total of 8 kinds, namely, int, short, long, byte, float, double, string, Boolean, char (note, and there is no basic type of C + +). This type of definition is defined by a form such as int, a = 3, long, B = 255L, and is called an automatic variable. It is important to note that automatic variables store literals, not instances of classes, that are not references to classes, an

您可能关注的文档

文档评论(0)

jgx3536 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:6111134150000003

1亿VIP精品文档

相关文档