[4] JAVA array and IDEA installation


Thirty-one, IntelliJ IDEA installation

IntelliJ IDEA (IDEA) or eclipse is more convenient to manage our projects.
IDEA is installed according to the tutorial in [1] Basic concepts of JAVA . The following figure shows the configuration of associated files in the process:
insert image description here

Thirty-two, IDEA runs the first program

1. Create a new empty project
2. Create a new module
3. Create a new package (com.) in src
4. Create a new class in the package
5. Write code
6. Execute

Thirty-three, IDEA project structure

insert image description here

Thirty-four, IDEA content auxiliary keys and shortcut keys

insert image description here
insert image description here

Thirty-five, IDEA module creation, deletion and import

1. Create: new module
2. Delete: remove module or delete the file directly
3. Import: Import module

Thirty-six, array

Definition: Array (array) is a storage type used to store multiple data of the same type .
Format 1: data type [] variable name
format 2: data type variable name [] (not recommended)
array initialization:
  dynamic initialization: only specify the length of the array during initialization, and the system assigns the initial value to the array
insert image description here
  static initialization: specify each The initial value of the array element, the length of the array is determined by the system
Format: data type [] variable name = new data type [] {data 1, data 2,...}; simplified
format: data type [] variable name = {data 1, data 2,…};

Note: 1. Get the number of arrays: array name.length
  2. Common errors in arrays: index out of bounds and null pointer

Thirty-seven, memory allocation

insert image description here
This involves the concept of the stack :
insert image description here
the stack can be simply understood as the address pointing to the heap

Guess you like

Origin blog.csdn.net/qq_37249793/article/details/121256129