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

[찬인] 문자열 덧셈 계산기 #11

Open
wants to merge 8 commits into
base: pci
Choose a base branch
from
Open

[찬인] 문자열 덧셈 계산기 #11

wants to merge 8 commits into from

Conversation

pci2676
Copy link
Member

@pci2676 pci2676 commented Mar 3, 2020

No description provided.

@pci2676 pci2676 changed the title 박찬인 [찬인] 문자열 덧셈 계산기 Mar 3, 2020

import java.util.List;

public interface SplitStrategy {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오와ㅣㅇ 이렇게 분리하는거 왜 생각못했지 ; .; 굿굿

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

당근이 제법 달군요..


public class Calculator {

public static int calculate(String expression) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

박찬인씨의 정적클래스 선택기준이 궁금합니다

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

멤버변수에 대한 의존성이 없어서..?
SplitStrategy는 인터페이스로 작성해야 하니까 그렇게 할수 없었구..
static으로 작성하려면 default 메서드가 되야했으니까..!!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이펙티브자바 140 페이지를 참고하여 기본생성자를 private 으로 명시하고 인스턴스화를 막아보는건 어떨까?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

와! 놓쳤던 부분 감사합니당


@DisplayName("null 또는 공백을 입력할 경우 0을 반환")
@ParameterizedTest
@NullAndEmptySource
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오? null 이랑 "" 두개 검사하는건가

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넴 Stringd에 두 가지가 들어가지요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants