728x90
반응형
https://livelyoneweek.tistory.com/3
int, Integer 차이는 무엇인가
int, Integer 차이는 무엇인가 int 는 변수의 타입(data type) 이다. 여기서 변수는 값을 저장할 수 있는 메모리 상의 공간이다. int a = 3; 에서 a는 변수명이다. int는 변수의 타입( data type = 자료형) 이
livelyoneweek.tistory.com
int는 기본 자료형이고,
Integer는 int를 객체로 다루기 위해 사용하는 클래스로 래퍼클래스(wrapper class)라고 부른다.
int 는 null값을 할당 받지 못하고,
Integer는 null 값을 할당할 수 있다.
728x90
반응형
'JAVA' 카테고리의 다른 글
[JAVA] ArrayList index 접근 (0) | 2023.07.12 |
---|---|
[JAVA] length, length(), size() 차이점 / list 길이구하기 (0) | 2023.07.03 |
[JAVA] Map, List 빈 객체인지 확인하기 (0) | 2023.04.25 |
[JAVA] Map key 값 이용하여 value 가져오기 (0) | 2023.04.22 |
[JAVA] isEmpty() / isBlank() (0) | 2023.04.21 |