Stack of data stores

Source: Internet
Author: User

The data stored in the stack is: the parameters in the method disappear as the method finishes executing

The data stored by the heap is: new object, allocated by the programmer memory

Global zone: Static data and constants


 PublicClass mytest{intMath; intChinese;  PublicMyTest (intMathintChinese) {        This. Math =Math;  This. Chinese =Chinese; }       Public intsaysomething () {intTotal = This. Math + This. Chinese; returnTotal ; }  }  PublicClass test{Static voidMain () {intMath = -;//Stack    intChinese = the;//Stack    Static  intAA = +;//Global Zone//myTest Stack New myTest (Math,chinese) heapMyTest MyTest =NewMyTest (Math, Chinese); intTotal = Mytest.saysomething ();//Stack  }}

Detailed introduction of http://blog.sina.com.cn/s/blog_8e7c33e9010100e5.html in this article.

Stack of data stores

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.