JAVA/CollectionFramework (2) 썸네일형 리스트형 List MainWrapper package ex02_List; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class MainWrapper { public static void ex01() { Listseason; season=new ArrayList(); season.add("여름"); season.add("가을"); season.add("겨울"); season.add(0,"봄");//위치, 요소 for(int i=0,length=season.size();i generic 예제 MainWrapper package ex01_generic; public class MainWrapper { public static void main(String[] args) { //String을 저장하는 box1 Boxbox1=new Box(); box1.setItem("Hello world"); System.out.println(box1.getItem()); //Integer 를 저장하는 box2 Boxbox2=new Box(); box2.setItem(3); System.out.println(box2.getItem()); //Person을 저장하는 box3 Boxbox3=new Box(); box3.setItem(new Person("김응가")); System.out.println(box3.ge.. 이전 1 다음