-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayTest2.java
More file actions
35 lines (33 loc) · 1.01 KB
/
Copy pathArrayTest2.java
File metadata and controls
35 lines (33 loc) · 1.01 KB
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
package com.company.array;
/**
* @author 苏东坡
* @company 公司
* @create 2021-07-28-9:09 上午
*/
public class ArrayTest2 {
public static void main(String[] args) {
/**
* 数组的定义: 数组是用来存储相同的数据类型,我们称之为数组
* 数组的作用: 用啦存储相同的数据类型
* 1、声明
* 2、创建
* 3、赋值
* 4、使用
*
* 数组分为基本数据类型的数组 引用数据类型的数组
* 数组中如果有两个不同的数据类型,根据赋值的不同,决定使用哪个数据类型为开始位置,离他最近的
* byte[] ---->0
* short[] ----->0
* char[] --->'u\000'
* int[] --->'0'
* long[] ---> '0'
* float[] ----> '0'
* double[] ---> '浮点型'
* boolean[] -->false
*/
int[] arr;
arr = new int[10];
arr[0] = 10;
System.out.println(arr[0]);
}
}