참조 타입 (1) 썸네일형 리스트형 박싱과 언박싱 String은 참조형 변수인가? 지난 포스팅을 안본 사람은 보는걸 추천한다. 기본형 타입과 참조 타입의 차이를 알고 있는가? 아래의 선언중 2개는 문제가 있다. //1번 int s1 = 5; int s2 = 10; int ss1 = new int(5); int ss2 = new int(10);//2번 Integer s1 = 5; Integer s2 = 10; int ss1 = new Integer(5); int ss2 = new Integer(10);//3번 int s1 = 5; int s2 = 10; Integer ss1 = new int(5); Integer ss2 = new int(10);정답은 1번과 3번이다 기본 타입은 객체로 사용할 수 없다. 객체로 사용하기 위해 래퍼클래스가 따로 존재하며 이.. 이전 1 다음