04_배열
public class Start { //배열의 선언방법 public static void exam1(){ //명시적 배열 생성 int [] arr1 = new int[10]; //암시적 배열 생성 int [] arr2 = {1,2,3,4,5,6,7,8,9}; } //배열에서의 울타리말뚝 오류 public static void exam2(){ try{ int[] arr = new int[2]; arr[2] = 10; } catch(java.lang.IndexOutOfBoundsException e){ System.out.println(e.getMessage()); } } //배열 복사 public static void exam3(){ int [] source = new int[]{5,4,6,9,7,9};..
2021. 11. 29.