Home > Java > javaTutorial > body text

Detailed introduction to the stack area

零下一度
Release: 2017-06-10 15:05:53
Original
1818 people have browsed it

The following editor will bring you an article that discusses the Java heap area, method area and stack area in detail. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let's follow the editor and take a look. Heap area: only stores class objects, shared by threads; method area: also called static storage area, stores class files and static data, shared by threads; stack area: stores method local variables, basic type variable area , execution environment context, operation instruction area, threads are not shared; class A { private String a = “aa”; //a is in the heap area public boolean methodB() { String b = “bb”; //b is in the stack area final&n

1. A brief introduction to the code examples of the heap area, method area and stack area in java

Detailed introduction to the stack area

##Introduction: The editor below will bring you an article that discusses the Java heap area, method area and stack area in detail. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look

2. Detailed explanation of several garbage collection principles in Java

Detailed introduction to the stack area

Introduction: In Java, except for basic types such as integers and references, all objects are allocated in the heap area instead of the stack area. This design eliminates the need for programmers to pay attention to the life cycle of variables, but at the cost of generating more garbage.

3. Details introduction to in-depth analysis of Javascript closures and code implementation methods

Detailed introduction to the stack area

##Introduction: 1. What is closure? Closure, the official explanation of closure is: an expression (usually a function) that has many variables and an environment bound to these variables, so These variables are also part of the expression. Characteristics of closure: 1. As a reference to a function variable, it is activated when the function returns. 2. A closure is a stack area that does not release resources when a function returns. To put it simply..

4.

[PHP] Linked list data structure (singly linked list) php gets database data php displays database data php database insertion number

Introduction: Data structure, php: [PHP] Linked list data structure (singly linked list): Linked list: It is an ordered list, but it is stored dispersedly in the memory, which can be solved by using a linked list Similar to Joseph's problem, sorting problem, search problem, generalized list one-way linked list, two-way linked list, circular linked list. The bottom layer of PHP is C. When a program is running, the memory is divided into five areas (heap area, stack area, global area, constant area, Code area) stipulates: basic data types, generally placed in the stack area. Composite data types, such as objects, are placed in the heap area. Define a class Hero. Define member attribute ranking $no. Define member attribute name. $name. Define member attribute nickname. $nickname

5.

Under what circumstances are constants generally defined?

Introduction: Under what circumstances are constants generally defined? A newbie asks, the values ​​of constants and variables are the same, do they exist in the memory and in the stack area? Why is there such a thing as constant? Anyway, they are all stored values, so it will be easy to replace them directly with variables. What are the typical situations where constants and variables are used? ------Solution--------------------You should know some by looking at the name. One can be modified. An unmodifiable------Solution--------------------Close

6.

Understanding JS closure

Introduction: First explain the characteristics of closure, which should be better understood. Two characteristics of closure: 1. As a reference to a function variable – When the function returns, it is active. 2. A closure is a stack area that does not release resources when a function returns. In fact, the above two points can be combined into one point, that is, when the closure function returns, the internal variables of the function are activated,

7.

A few simple sentences to explain the closure of JavaScript_ javascript skills

Introduction: What is closure? Closure is a stack area that is dynamically generated without released resources during the execution of a function instance. It is also a pre-execution process.

【Related Q&A recommendations】:

objective-c - How to get the maximum and minimum values ​​in the stack area?

Memory Management - What is the HEAP SIZE limit per process in Linux?

Java: What is the distribution of the addition of different Strings in memory?

ios - Good afternoon everyone, how to check whether an object is in the heap or stack area in xcode?

The above is the detailed content of Detailed introduction to the stack area. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!