타입[] 변수이름;
변수이름 = new 타입[길이];
ex)
int[] score;
score = new int[5];
: 각 요소에 자동으로 붙는 (일련)번호
int[] score = new int[5]; // 인덱스 범위는 0~4
int[] arr = new.int[5];
int tmp = arr.length; // arr.length의 값 5가 tmp에 저장
: 배열의 각 요소에 처음으로 값을 저장하는 것
// 1번 방법
int[] score = new int[5];
for (int i = 0; i < score.length; i++)
score[i] = i * 10 + 50
// 2번 방법
int[] score = {50, 60, 70, 80, 90}
// 에러 주의
int[] score;
score = {50, 60, 70, 80, 90}; // 이렇게 두 줄로 나눠서 쓰면 안됨