Skip to content

submit step6 1st - #120

Merged
javajigi merged 1 commit into
code-squad:kkssryfrom
kkssry:step6
Oct 19, 2018
Merged

javajigi merged 1 commit into
code-squad:kkssryfrom
kkssry:step6

Conversation

@kkssry

@kkssry kkssry commented Oct 19, 2018

Copy link
Copy Markdown

No description provided.

@kkssry

kkssry commented Oct 19, 2018

Copy link
Copy Markdown
Author

Point 클래스에서 좌표값 x,y를 하나의 객체 인식하여 캡슐화 연습을 할겸 PointNumber 클래스를 만들었습니다. 근데 PointNumber에 접근하려고 getNumber메서드를 만들었는데 이렇게 하는게 맞는지 다른 방법이 존재 하는지 궁금합니다.

@javajigi javajigi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PointNumber를 추가한 건 잘 했네요.
PointNumber에도 메시지를 보내면 되죠?


public double calculatorLength(Point point) {
return Math.sqrt(Math.pow(this.x - point.x, 2) + Math.pow(this.y - point.y, 2));
return Math.sqrt(Math.pow(this.x.getNumber() - point.x.getNumber(), 2) + Math.pow(this.y.getNumber() - point.y.getNumber(), 2));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

x.pow(point.x)와 같이 구현해도 되지 않을까?

@javajigi
javajigi merged commit ccfb821 into code-squad:kkssry Oct 19, 2018
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