c
int arr[10];
int arr[ ] = {1,2,4};
int arr[10] = {1,2};
c++
int* arr= new int[100];
java
int[ ] arr=new int[6];
int[ ] arr={1,2,3,4};
int[ ] arr= new int[ ]{1,2,3,4,5};
javascript
var arr=new Array();
var arr=new Array("aaa","bbb","ccc");
php
$arr = array('a','b','c');
$arr[ ] = 'a'; $arr[ ] = 'b'; $arr[ ] = 'c';
echo $arr[1]; //输出b
$arr = array(1=>'aaa',2=>'bbb',500=>'ccc');
echo $arr[500]; //输出ccc