전.java
char 형 배열 (개선된 for 문)
1. for 문 char[] com = { ‘C’, ‘o’, ‘m’, ‘p’, ‘u’, ‘t’, ‘e,’ ‘r’}; // ... for (int i = 0; i < com.length; i++) System.out.println(com[i]); 2. 개선된 for 문 char[] com = { ‘C’, ‘o’, ‘m’, ‘p’, ‘u’, ‘t’, ‘e,’ ‘r’}; // ... for (char c: com) System.out.println(c);
2021. 1. 31. 15:24