基本類型java
int[] myIntArray = new int[3]; int[] myIntArray = {1,2,3}; int[] myIntArray = new int[]{1,2,3};
至於類,好比 String ,也是同樣的:spa
String[] myStringArray = new String[3]; String[] myStringArray = {"a","b","c"}; String[] myStringArray = new String[]{"a","b","c"};