Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[item1] 동반 클래스(Companion class)? #5

Open
jun108059 opened this issue Sep 7, 2022 · 1 comment
Open

[item1] 동반 클래스(Companion class)? #5

jun108059 opened this issue Sep 7, 2022 · 1 comment
Labels
👍 Additional 추가로 공부하고 공유한 내용입니다.
Milestone

Comments

@jun108059
Copy link
Member

jun108059 commented Sep 7, 2022

[item1] 생성자 대신 정적 팩터리 메서드를 고려하라

Java8부터 왜 동반 클래스를 따로 정의하지 않아도 될까요?

@jun108059 jun108059 added this to the chapter2 milestone Sep 7, 2022
@jun108059 jun108059 added the 👍 Additional 추가로 공부하고 공유한 내용입니다. label Sep 7, 2022
@sawooook
Copy link
Member

자바8 이후 부터는 인터페이스에 정적 메서드를 추가 할 수 있어서 동반클래스를 따로 정의 하지 않아도 되나 봅니다!
http://happinessoncode.com/2017/04/19/java8-changes-in-interface/#%EC%A0%95%EC%A0%81-%EB%A9%94%EC%84%9C%EB%93%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👍 Additional 추가로 공부하고 공유한 내용입니다.
Projects
None yet
Development

No branches or pull requests

2 participants