반응형
package edu.collection;
import java.util.ArrayList;
public class CollectionEx1 {
public static void main(String[] args) {
String[] arr = new String[2];
arr[0] = "apple";
arr[1] = "orange";
//arr[2] = "melon";
for(int i=0; i al = new ArrayList();
al.add("apple");
al.add("orange");
al.add("melon");
for (int i = 0; i < al.size(); i++) {
//String str = (String)al.get(i);
String str = al.get(i);
System.out.println(str);
System.out.println(al);
System.out.println(al.hashCode());
}
}
}
'JAVA' 카테고리의 다른 글
| JAVA 자바 HashMap ("지역번호","지역") (0) | 2018.02.09 |
|---|---|
| [JAVA] 자바 부분집합, 교집합, 합집합, 차집합 (0) | 2018.02.08 |
| JAVA 자바 List, Set 차이 (0) | 2018.02.08 |
| JAVA 자바 빵 주문/생산일자/유통기한 (0) | 2018.02.08 |
| JAVA 자바 빵/랜덤/시간/count (0) | 2018.02.08 |
댓글