배열예제4 public class Ex10_4{ public static void main(String[] args){ int [] num = {1, 2, 3}; for(int i : num){ System.out.println(i); } String [] name = {"홍길동", "유관순", "이순신"}; for(String n : name){ System.out.println(n); } } } 더보기 배열예제3 public class Ex10_3{ public static void main(String []args){ int [] num = new int[4]; num[0] = 1; num[1] = 2; num[2] = 3; for(int i : num){ System.out.println(i); } String[] name= new String[4]; name[0] = "홍길동"; name[1] = "유관순"; name[2] = "이순신"; for(String n : name){ System.out.println(n); } } } 더보기 배열예제2 public class Ex10_2{ public static void main(String[] args){ String [] name; name = new String[4]; name[0] = "홍길동"; name[1] = "이순신"; name[2] = "유관순"; for(int i = 0; i 더보기 배열 예제1 public class Ex10_1{ public static void main(String[] args){ int [] num; num = new int[4]; num[0] = 1; num[1] = 2; num[2] = 3; for( int i = 0 ; i 더보기 배열 실습 public class ExamEx42{ public static void main(String []args){ int[][] arrNumber = {{1, 2},{3, 4},{4, 5}}; for(int[] arrTmp : arrNumber){ for (int i : arrTmp ){ System.out.println("데이터 : " + i); } } } } 더보기 이전 1 ··· 31 32 33 34 35 36 37 다음