Primitive vs Object Type
원시타입과 참조타입
원시타입
참조타입
예시 코드:
int a = 5;
int b = a; // b는 a의 값을 복사하여 가집니다.
String s1 = new String("Hello");
String s2 = s1; // s2는 s1이 참조하는 객체를 동일하게 참조합니다.Last updated
원시타입과 참조타입
int a = 5;
int b = a; // b는 a의 값을 복사하여 가집니다.
String s1 = new String("Hello");
String s2 = s1; // s2는 s1이 참조하는 객체를 동일하게 참조합니다.Last updated