2019.12.10 define arrays and memory into java

// Data type [] = new Array Data Type Name [number of elements or array of length]; 

int [] X = new new  int [100];
// Type [] array name = new type [] {elements, elements ......};
String [] arr = new new String [] { "SpongeBob SquarePants," "Patrick", "Octopus", "Jarry" , "Tom"};

 

1. Stack (Stack): a method which is stored in the local variables. (Method must be running in the stack.) Local variables: parameters of the method, or a method of internal variables {}. Scope: Once out of scope (braces), and immediately disappeared from the stack memory.

2. heap (Heap): Any new out of something, are among the heap memory, such as an array. Heap memory which has an address value: hex, the heap of data have default values.

3. The method of region (Method Area): storing .class information, the method comprising the information.

4. A native method stacks (Native Method Stack): related to the operating system.

5. register (pc Register): related to the cpu.

Guess you like

Origin www.cnblogs.com/l1314/p/12016595.html