1 package com.karl1; 2 3 public class ArrayDemo { 4 public static void main(String[] args) { 5 //静态初始化数组 6 7 //1.数据类型[] 数组名=new 数据类型[]{元素1,元素2,元素3.。。。。}; 8 int[] ages = new int[]{1,24,36}; 9 double[] scres=new double[]{89.9,66.4,33.2}; 10 11 12 //2.简化格式 13 //数据类型[] 数组名={元素1,元素2.。。。。}; 14 int[] age ={1,24,36}; 15 double[] scre={89.9,66.4,33.2}; 16 17 18 //3.数据类型[] 数组名 也可以写成 数据类型 数组名[] 19 int age1[] ={1,24,36}; 20 double scre1[]={89.9,66.4,33.2}; 21 } 22 }
标签:24,初始化,66.4,静态,double,数据类型,int,数组名,数组 From: https://www.cnblogs.com/Karl-hut/p/17437934.html