가비지 질문입니다.
다미
2023.04.01
class Test{
private Demo d;
void start() {
////d = new Demo();
this.takeDemo(d);
}
void takeDemo(Demo demo){
demo = null;
demo = new Demo();
}
}
주석처리된 부분의 Demo object 가 가비지콜렉션에 eligible 되는 때는 언제냐는데요.
답은 when the instance running this code is made eligible for garbage collection
이래요. 왜 이게 답인가요..?