배열
String[] users = new String[3]; //크기 3개로 지정
users[0] = "A";
users[1] = "B";
users[2] = "c";
System.out.println(users[1]); //B
System.out.println(users.length); //3
int[] scores = {10, 55, 100};
System.out.println(scores[1]); //55
배열과 반복문
String[] users = new String[3];
users[0] = "A";
users[1] = "B";
users[2] = "c";
for(int i=0; i<users.length ; i++) {
System.out.println(users[i]+"!!");
}
// A!!
// B!!
// C!! 배열과 반복문
'시작 전' 카테고리의 다른 글
반복문 - while 과 for (0) | 2022.07.07 |
---|---|
제어문 - 연산자 (0) | 2022.07.07 |
제어문 - 조건문 (0) | 2022.07.07 |
App 만들기 - 기본기능 (0) | 2022.07.01 |
arguments & parameter (0) | 2022.06.30 |