-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.java
More file actions
39 lines (36 loc) · 976 Bytes
/
Array.java
File metadata and controls
39 lines (36 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package JavaSE;
/*
1.引用数据类型
2.数组内类型统一
3.不能长度修改
常见初始化:
1。动态初始化(指定长度)(可拆分):int[] arr = new int[5];
2。静态初始化(指定内容)(可拆分):int[] arr = new int[] {1,2,3};
省略格式(不可拆分) int[] arr ={1,2,3};
数组变量名打印出来就是 数组内存地址哈希值
*/
public class Array {
public static void main(String[] args) {
int[] arrA = new int[300];
// int[] arrA;
// arrA = new int[300];
int[] arrB = new int[] {5,15,25};
//int[] arrB;
//arrB = new int[] {5,15,25};
int[] arr ={1,2,3};
int len = arr.length;
System.out.println(len);
// for (int i = 0; i < arr.length; i++) {
//
// }
// arr.fori
}
}
/*
数组自动初始化:
整数:0
浮点数:0.0
字符: '\u0000'(不可见)
布尔: false
引用: null
*/