数组
数组
1.数组的定义及基本应用
1.1 数组的定义
概念:一组连续的存储空间,存储多个相同数据类型的值。
特点:类型相同,长度固定。
public class TestDemo1 {
public static void main(String[] args) {
//其中int[] a表示声明int数组类型变量,定义变量名为a。
//new int[5]表示分配长度为5的来纳许空间
int[] a = new int[5];
}
}
数组