Skip to content

아이템 9. try-finally보다는 try-with-resources를 사용하라 #28

Answered by JoisFe
coalong asked this question in 3. 과제
Discussion options

You must be logged in to vote

정리 감사합니다. try-with-resource 구조를 사용하려면 해당 자원이 AutoCloseable 인터페이스를 구현해야 한다. 라고 하셨는데 Closeable 인터페이스를 구현한 객체 또한 try-with-resource 구조를 사용할 수 있는 것으로 알 고 있습니다.
AutoCloseable과 Closeable의 차이가 무엇일까요?

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@chikeem90
Comment options

@coalong
Comment options

coalong Dec 26, 2022
Maintainer Author

@JoisFe
Comment options

Answer selected by coalong
Comment options

You must be logged in to vote
3 replies
@chikeem90
Comment options

@coalong
Comment options

coalong Dec 26, 2022
Maintainer Author

@Irisation23
Comment options

Comment options

You must be logged in to vote
1 reply
@coalong
Comment options

coalong Dec 28, 2022
Maintainer Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2장 객체 생성과 파괴 이펙티브 자바 2장 (객체 생성과 파괴)
5 participants