
원시 자료형을 레퍼런스 자료형으로 쓸 수 있다. (기본 데이터 타입을 객체로 감싸주는 역할)
ex)
int → Integer | double → Double | boolean → Boolean | long → Long |
레퍼런스 타입이라 앞에 대문자로 시작 (Integer 빼고는 대문자 외엔 생김새가 다 같다)
ex) int(원시자료형)를 integer(레퍼런스 타입)로

num이 프리미티브 타입이라 아무 메소드도 나오지 않음

Integer로 바꾸니 메소드 들고 있음. 기본 데이터 타입을 객체로 감쌈! ex) doubleValue = integer타입을 double타입으로 바꿔주는 것
Share article