int []a = new int[] {2,4,6,8,10};

선언과 동시에 초기화하는 경우 크기를 명시하지 않는다.

int []b = {1,3,5,7,9};

배열선언과 초기화를 동시에 하는 경우 new int[]를 생략할 수 있다.

+ Recent posts