package CHAPTER08;

public class FinalizeExample {
	//@SuppressWarnings("removal")
	@Override
	protected void finalize() throws Throwable { 
		System.out.println("FinalizeExample 객체가 소멸되기 직전입니다.");
		super.finalize(); // Object의 finalize 호출
	}

	public static void main(String[] args) {
		FinalizeExample obj = new FinalizeExample();
		obj = null; // 참조 제거 → GC 대상

		System.gc(); // GC 호출 요청

		System.out.println("main() 메서드 종료");
	}
}