Data Storage: Class Field variables are not initialized to get a default value. Non-Class Field variables will not have this guarantee. Java Data Storage (1) Register (Registers). This is the fastest storage area because it is located in a location different from all other saving methods: the processor inside. However, the number of registers is very limited, so the register is assigned by the compiler as needed. You don't directly control the register, even the evidence it exists. (2) Stack. Located in the "General Random-Access Memory Area", the processor can be directly accessed through the Stack Pointer. The Stack Pointer creates a new storage, and the up is thought to release the memory space. This is The size of the data stored in the stack because the Java compiler must generate the code that can control the moving or downward movement of the stack pointer, the size of the data stored in the stack And the life cycle must be known. This makes the flexibility of the program are limited, so although Java stores some data such as the object's Reference in the stack, the object itself is not placed in the stack, but placed in Heap I. (3) Heap. A conventional use of memory pool (also in the RAM area), which saves Java objects. Unlike the stack, "Memory" or "Heap" The most attractive place is that the compiler does not have to know how much storage space is to be allocated from the heap, and you don't have to know how long the stored data is to stay in the stack. Therefore, greater flexibility is obtained when saving data with a stack. When you create an object, just use the new command to prepare the relevant code. When you perform these code, you will automatically save the data in the stack. Of course, in order to achieve this flexibility, it will inevitably pay a certain price: it will take a longer time when allocating the storage space! (4) Static storage. "Static" here refers to "located in a fixed position" (although in the RAM). During the operation, the static stored data will wait any time. The STATIC keyword can be used to indicate a particular element of an object is static. But the Java object itself will never place static storage. (5) constant storage. The constant value is usually placed inside the program code. This is safe because they will never change. Some constants need to be strictly protected, so they can consider placing them into read-only memory (ROM). (6) Non-RAM storage. If the data is completely independent of a program, the program can still be present when the program is not running, and outside the program's control range. Two of the most important examples are "flow objects" and "fixed objects". For streaming objects, the object will become byte stream, which is usually sent to another machine. For fixed objects, the object is saved in the disk. They still keep their own status unchanged even if the program is aborted. For these types of data stores, a particularly useful technique is that they can exist in other media. Once needed, they can even return them into ordinary, RAM-based objects. Static Keywords: Declaration Data or Method is Static, it is said that there is no instance that is connected to the class, so even if you never create the object, you can also call its Static method or access its Static data. It has a memory that saves these data. You cannot call non-Static methods in the Static method. Not passing the object directly to the Static method is the intention of the Static method. Class STATIC method can only access other Static methods and Static data members .static Data is only initialized once.